Copyright © tutorialspoint.com

PERL fileno Function


Syntax

fileno FILEHANDLE


Definition and Usage

Returns the file descriptor number (as used by C and POSIX functions) of the specified FILEHANDLE. This is generally useful only for using the select function and any low-level tty functions.

Return Value

  • File descriptor (numeric) of FILEHANDLE

  • undef on failure

Example

You can use this to find out whether two handles refer to the same underlying descriptor:

   if (fileno(THIS) == fileno(THAT)) {
	print "THIS and THAT are dups\n";
   }

Copyright © tutorialspoint.com