You are viewing the version of this documentation from Perl 5.34.3. View the latest version
fcntl may also refer to the module: Fcntl
fcntl FILEHANDLE,FUNCTION,SCALAR

Implements the fcntl(2) function. You'll probably have to say

use Fcntl;

first to get the correct constant definitions. Argument processing and value returned work just like ioctl below. For example:

use Fcntl;
my $flags = fcntl($filehandle, F_GETFL, 0)
    or die "Can't fcntl F_GETFL: $!";

You don't have to check for