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

Right now, you have no file handles to those data files to speak of, so it's odd how you are getting even that data. The way you want to do it is:
foreach my $file (@ARGV) { if ( -e $file ) { # double check existence push @data, $file; open FILE , '<'.$file or die $!; while( <FILE> ) { push @data, $_; } close FILE; } }

Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: Re: How do I read the files in @ARGV one by one
by isotope (Deacon) on Mar 19, 2001 at 23:46 UTC
    It's not odd because he's using the <> operator, which returns all the data from all the files listed in @ARGV, all in one pass, line by line. It doesn't let you break it up by file, though.

    --isotope
    http://www.skylab.org/~isotope/