note
blazar
<p>Nice approach. And my be merged with [id://548210|mine], e.g.:</p>
<c>
#!/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__
</c>
<p>However:</p>
<ul>
<li>you should <c>s/undefined/uninitialized/;</c></li>
<li><strike>it may not be fully reliable if empty lines are to be expected in the files.</strike></li>
</ul>
<p><strong>Update:</strong> the second point was a thinko as [Zaxo] [id://548208|pointed out].</p>
548184
548208