Perl fcntl Function
This function is the Perl version of the system fcntl( ) function. Performs the function specified by FUNCTION, using SCALAR on FILEHANDLE. SCALAR either contains a value to be used by the function or is the location of any returned information.
Following is the simple syntax for this function −
fcntl FILEHANDLE, FUNCTION, SCALAR
This function returns 0 but true if the return value from the fcntl()is 0 Value returned by system and undef on failure.
Following is the example code showing its basic usage −
When above code is executed, it produces the following result −