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"; }
In reply to Reading multiple files into array by perlNinny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |