Perl functions references-eof Function - Perl Scripting

what is Perl eof function?

Description

This function helps in returning 1 if the next read on FILEHANDLE will return end of file, or if FILEHANDLE is not open.
An eof without an argument uses the last file read. Using eof() with empty parentheses is very different. It connects to the pseudo file formed from the listed files on the command line and accessed via the <> operator.

Syntax

Following is the simple syntax for this function −

Return Value

This function returns undef if FILEHANDLE is not at end of file and 1 if FILEHANDLE will report end of file on next read.

Example

Following is the example code showing its basic usage −

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Perl Scripting Topics