On Tue, 10 Apr 2001 21:57:12 -0700, Eric W Dahlstrom wrote:
>I am a newbie to Perl and I am trying to bring several files into their own
>separate arrays for processing in a single script.
>Currently I am able to read in the files, but they all dump into a single
>array. I need to create a new array for each file, but I am not sure how
>this is done.
>Is there an easy way to increment the array for each file?
Ignoring the details of your script, look at this for an example:
@ARGV = ("1.fsa", "2.fsa", "3.fsa");
while(<>) {
push @{$contents{$ARGV}}, $_;
}
See what we got:
use Data::Dumper;
print Dumper \%contents;
For example, the first line of file "2.fsa" is in $contents{"2.fsa"}[0].
--
Bart.