in reply to Determining new file

You can use eof to check for end of file. There is an example similar to what you want in the perldoc for eof. Something like:
# insert dashes just before last line of last file while (<>) { # Do stuff with each line if (eof) { # check for end of current file print "I am at the end of the file\n"; close(ARGV); # close or last; is needed if we # are reading from the terminal } }
Update: Corrected eof() to eof

Replies are listed 'Best First'.
Re: Re: Determining new file
by Thelonius (Priest) on Mar 28, 2003 at 07:36 UTC
    Use eof without parentheses to test for end of each individual file in ARGV.