eof FILEHANDLE eof () eof Returns 1 if the next read on FILEHANDLE will return end of file, or if FILEHANDLE is not open. FILEHANDLE may be an expression whose value gives the real filehandle. (Note that this function actually reads a character and then "ungetc"s it, so isn't very useful in an interactive context.) Do not read from a terminal file (or call "eof(FILEHANDLE)" on it) after end-of-file is reached. File types such as terminals may lose the end-of-file condition if you do.