in reply to How do I read the files in @ARGV one by one

Have a look at 'eof', it will tell you when a file ends.

perldoc -f eof

  • Comment on Re: How do I read the files in @ARGV one by one

Replies are listed 'Best First'.
(tye)Re: How do I read the files in @ARGV one by one
by tye (Sage) on Mar 19, 2001 at 21:19 UTC

    I'd like to encourage you to check out the above advice.

    Here is an alternative that I am becoming fond of:

    my @data; foreach my $file (@ARGV) { push @data, substr( $file, -12, 12 ); local( *ARGV ); @ARGV= ($file); push( @data, <> ); }

            - tye (but my friends call me "Tye")