http://www.perlmonks.org?node_id=961554


in reply to Re^2: Rewrite Program Using Arrays
in thread Rewrite Program Using Arrays

Hm, I suppose you meant something like this:
my @globalarray; foreach my $filename (@ARGV) { open my $fh, '<', $filename or die "$filename: $!"; my @temparray = <$fh>; push @globalarray, @temparray; close $fh; }
Guess you could learn the use of "push", that's about the only thing. It's used to append a scalar or a whole list to the end of an array. "pop" does the opposite and takes one scalar off. shift and unshift work the same, just on the start of the array.