I have a few minor nits to pick with your example.
The change would look something like this:
while (keys %fh) { foreach my $fh (keys %fh) { if (defined(my $line = <$fh>)) { chomp $line; print $line; } else { close($fh); delete($fh{$fh}); } } }
In reply to Re^4: Merging files
by cazz
in thread Merging files
by sk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |