Help for this page

Select Code to Download


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