Perl close Function

Advertisements


Description

This function closes FILEHANDLE, flushing the buffers, if appropriate, and disassociating the FILEHANDLE with the original file, pipe, or socket. Closes the currently selected filehandle if none is specified.

Syntax

Following is the simple syntax for this function:

close FILEHANDLE

close

Return Value

This function returns 0 on failure and 1 if buffers were flushed and the file was successfully closed.

Example

Following is the example code showing its basic usage:

#!/usr/bin/perl


When above code is executed, it produced following result:




Advertisements
Advertisements