in reply to multiple (different) substitutions on same $foo
and you would be able to do the substitution at multiple points in your code, but only define what gets substituted once.%sub = ( frog => 'toad', man => 'boy', woman => girl ); $exp = join('|', keys %sub); $foo =~ s/($exp)/$sub{$1}/g;
|
|---|