in reply to end of

while (<FH>) { if (eof FH) { # has read for the last time } }

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
(bbfu) (eof seeks) Re2: end of
by bbfu (Curate) on Aug 25, 2001 at 03:16 UTC

    I would just like to note (for maddfisherman's sake, not your's japhy as I'm sure you're already aware :) that eof will not work if you're reading data from a socket, pipe, or terminal. This is because, the way eof works is it tries to read a character from the file, noting an EOF if found, and then ungetc's the character back onto the file's stream so that you can read it in.

    Of course, this probably won't affect this situation but I wanted to point it out, JIC.

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.