monkfan has asked for the wisdom of the Perl Monks concerning the following question:
Example 2:$filename = $ARGV[0]; #corrected from @ARGV[0] as suggested by eyepop +slikeamosquito open (FILE,"$filename") || die "Can't Open $filename: $!\n"; @LINES=<FILE>; #slurping into array foreach my $line(@LINES){ #process something here }
$filename = $ARGV[0]; open (FILE,"$filename") || die "Can't Open $filename: $!\n"; while<FILE>{ #dealing with it per-lines #process something here }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Slurping file into array VS Process file line-by-line
by Corion (Patriarch) on Oct 27, 2004 at 07:21 UTC | |
Re: Slurping file into array VS Process file line-by-line
by jarich (Curate) on Oct 27, 2004 at 09:26 UTC | |
by ihb (Deacon) on Oct 27, 2004 at 10:19 UTC | |
Re: Slurping file into array VS Process file line-by-line
by eyepopslikeamosquito (Archbishop) on Oct 27, 2004 at 08:09 UTC | |
Re: Slurping file into array VS Process file line-by-line
by TedPride (Priest) on Oct 27, 2004 at 11:13 UTC |