Perl fcntl Function

Advertisements


Description

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.

Syntax

Following is the simple syntax for this function:

fcntl FILEHANDLE, FUNCTION, SCALAR

Return Value

This function returns 0 but true if the return value from the fcntl()is 0 Value returned by system and undef on failure.

Example

Following is the example code showing its basic usage:


When above code is executed, it produced following result:




Advertisements
Advertisements