Name

fileno

Synopsis

fileno filehandle

Description

Returns the file descriptor for a filehandle. (A file descriptor is a small integer, unlike the filehandle, which is a symbol.) It returns undef if the handle is not open. It’s useful for constructing bitmaps for select, and for passing to certain obscure system calls if syscall is implemented. It’s also useful for double-checking that the open function gave you the file descriptor you wanted.

Get Perl in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.