|
|
I dunno, summat like this
#!/usr/bin/perl -w
use strict;
# read in list
my %subs;
open(FILE, '<sublist.txt') || die;
while (<FILE> ) {
chomp $_;
if (/^([^\t]+)\t([^\t]+)$/) {
$subs{$1} = $2;
print STDERR "$1 => $2\n";
}
}
close FILE;
# substitute words
while (<> ) {
foreach my $key (keys %subs) {
my $sub = $subs{$key};
s/$key/$sub/g;
}
print $_;
}
and then you save a tab-delimited list of words to substitute as sublist.txt |
|
|