chrishowe has asked for the wisdom of the Perl Monks concerning the following question:
use strict; my @filestack; my $datafile = "text1.txt"; my $handle; my $i = 0; my @raw_data; open ($handle, $datafile); push (@filestack, $handle); $datafile = "text2.txt"; open ($handle, $datafile); push (@filestack, $handle); foreach my $file(@filestack){ print "$i\n"; @raw_data=<$file>; foreach my $temp(@raw_data){ print "$temp\n"; }; close($file); $i++; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Opening multiple files simultaneously
by kyle (Abbot) on Mar 31, 2009 at 14:36 UTC | |
by chrishowe (Acolyte) on Mar 31, 2009 at 15:42 UTC |