Next | Trivial Utilities | 33 |
@files = @ARGV;
foreach $f (@files) { my $fh = new FileHandle; if (open $fh, "< $f") { push @fhs, [$f, $fh, 0]; } else { warn "Couldn't open file `$f': $!; ignoring.\n"; } }
die "Couldn't open any files; aborting" unless @fhs;
Each of those @fhs items has a filename, filehandle, and file length
The main loop will scan over @fhs
It will try to read from each file
Then it will print out a report
Next | Menu | Copyright © 2012 M. J. Dominus |