in reply to multiple (different) substitutions on same $foo

Do it something like this way:
%sub = ( frog => 'toad', man => 'boy', woman => girl ); $exp = join('|', keys %sub); $foo =~ s/($exp)/$sub{$1}/g;
and you would be able to do the substitution at multiple points in your code, but only define what gets substituted once.