in reply to Naming file handles with variables?
Instead you could read in from standard input with a simple while ( <> ) { ... } and pipe input to the program from elsewhere. Or you could take a list of filenames as arguments in @ARGV and process them individually:
for my $file ( @ARGV ) { open my $fh, '<', $file or die "$file: $!"; while ( <$fh> ) { ... } close $fh; }
Perhaps I should ask: is there any particular reason you need all filehandles open at once?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Naming file handles with variables?
by vinoth.ree (Monsignor) on Apr 30, 2009 at 04:34 UTC | |
by whakka (Hermit) on Apr 30, 2009 at 04:38 UTC |