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


in reply to Re: Re: Re: Re: Re: Re: Unix Perl and Html
in thread Unix Perl and Html

something like this will read in all the files listed in @files. It also cuts down on repetitive code and allows scalability.

my @files= qw| /path/to/file1 /path/to/file2 /path/to/file3 |; my @allfiles; for my $filename(@files){ open(FILE," $filename") || die "Cannot open $filename: $!\n"; while(<FILE>) { push @allfiles, $_; } close(FILE); }

-p