#!/usr/bin/perl open A, "working/with-accents.lst"; open B, "working/without-accents.lst"; for (;;) { $with_accent = or last; chop $with_accent; $without_accent = or die; chop $without_accent; $lookup{$without_accent} = $with_accent; } while () { chop; if (exists $lookup{$_}) { print "$lookup{$_}\n"; } else { my $w = $_; s/\'s$//; if (exists $lookup{$_}) { print "$lookup{$_}'s\n"; } else { print "$w\n"; } } }