note
rjt
<p>Here's a short working example you can go from:</p>
<c>for (<*.txt>) {
open my $fh, '<', $_ or die "Can't open $_: $!";
my $record = join(', ', map { chomp; $_ } (<$fh>)); # <== HERE
print "$_: $record\n";
close $fh;
}</c>
<p>Just replace the line marked <c><== HERE</c> with your code. This writes to <c>STDOUT</c>, so you can redirect your output wherever you like, or just add an [doc://open] and [doc://select] to automate it if you'll always be writig to the same location.</p>
<p>Take care that the <c><*.txt></c> glob does not match your output file.</p>
1003832
1003832