eof
Tests whether the next read on a filehandle will return end-of-file.
Returns true (1) when the filehandle has reached end-of-file, or an
empty string (false) otherwise. Called without arguments, eof() checks
the filehandle most recently read via <> or readline.
If the filehandle is invalid or has never been read, returns true.
Synopsis
if (eof($fh)) { ... } # test specific filehandle
if (eof()) { ... } # test last-read filehandle
if (eof) { ... } # same as eof()