http://qs1969.pair.com?node_id=491541


in reply to How to get file descriptor (number)

$ perldoc -f fileno fileno FILEHANDLE Returns the file descriptor for a filehandle, or undefined if the filehandle is not open. This is mainly useful for con- structing bitmaps for "select" and low-level POSIX tty-handling operations. If FILEHANDLE is an expression, the value is taken as an indirect filehandle, generally its name. 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"; } (Filehandles connected to memory objects via new features of "open" may return undefined even though they are open.)

Dave.

Replies are listed 'Best First'.
Re^2: How to get file descriptor (number)
by Eyck (Priest) on Sep 13, 2005 at 12:39 UTC
    Thanks, that is exactly it!