in reply to Re: parallel reading
in thread parallel reading
Nice approach. And my be merged with mine, e.g.:
#!/usr/bin/perl -l use strict; use warnings; my @fh=map { open my $fh, '<', $_ or die "Can't open `$_': $!\n"; $fh } @ARGV; no warnings 'uninitialized'; print while $_=join '', map { chomp(my $line=<$_>); $line } @fh, __END__
However:
- you should s/undefined/uninitialized/;
it may not be fully reliable if empty lines are to be expected in the files.
Update: the second point was a thinko as Zaxo pointed out.
|
---|
In Section
Seekers of Perl Wisdom