in reply to Re^2: Multiple file input into a perl script
in thread Multiple file input into a perl script
The magic diamond-operator <> only works if you stuff the filenames into @ARGV. But you surely have tried that yourself and merely forgot to tell me that you found your code didn't work the way you wrote it.
I recommend you read up on open to learn how to open and read a single file and process that, and then proceed to do that in the loop:
use strict; use File::DosGlob qw(bsd_glob); my @files = glob 'ABi1*'; foreach my $file (@files) { open my $fh, '<', $file or die "Couldn't read '$file': $!"; while (<$fh>) { ... do your function }; # EOF, do end of file cleanup };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Multiple file input into a perl script
by broomduster (Priest) on Sep 30, 2008 at 22:11 UTC | |
by Corion (Patriarch) on Oct 01, 2008 at 05:42 UTC | |
by broomduster (Priest) on Oct 01, 2008 at 12:51 UTC |