my $foo = "The frog kissed the woman and became a man."; $foo =~ s/\b(frog|woman|man)\b/{frog=>toad,woman=>girl,man=>boy}->{$1}/eg;