s/$thing/$translate{$thing}/g; #### my $re = join '|', keys %translate; $re = qr/($re)/; while (<>) { s/$re/$translate{$1}/g; print; }