- or download this
#!/usr/bin/perl
use warnings;
use strict;
- or download this
my $infiles = '/path/to/RETAKC*.txt';
my $outpath = '/another/path/';
use File::Basename 'basename';
- or download this
my %substitute = (
'0000J' => '000-1',
# . . .
);
my $regex = qr/(${\join '|', keys %substitute})/;
- or download this
for my $file (glob $infiles) {
open my $in, '<', $file or warn $! and next;
open my $out, '>', $outpath.basename($file)
...
print $out $_;
}
}