perlNinny has asked for the wisdom of the Perl Monks concerning the following question:
So how do I put ALL the lines from ALL the files into @list?use FileHandle; my @list; my $file; my @d = ("ds","DD","df"); foreach $type (@d){ $file = "list_".$type.".txt"; open (fh, "<$file"); @list = <fh>; close fh; } foreach $output (@list){ chomp $output; print $output."\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading multiple files into array
by philcrow (Priest) on May 10, 2007 at 17:10 UTC | |
by perlNinny (Beadle) on May 10, 2007 at 18:02 UTC | |
|
Re: Reading multiple files into array
by leocharre (Priest) on May 11, 2007 at 13:30 UTC |