Perl close Function
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.
Following is the simple syntax for this function:
close FILEHANDLE close
This function returns 0 on failure and 1 if buffers were flushed and the file was successfully closed.
Following is the example code showing its basic usage:
When above code is executed, it produced following result: