--- name: eof status: documented runtime: pp source: src/runtime/pp/io.rs --- ```{index} single: eof; Perl built-in (pp runtime) ``` # eof ## Synopsis ```perl if (eof($fh)) { ... } # test specific filehandle if (eof()) { ... } # test last-read filehandle if (eof) { ... } # same as eof() ``` ## Description 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. ## See also readline, read, tell