One way:
See also the discussions linked from the Re: Evaluating $1 construct in literal replacement expression node and also its root.c:\@Work\Perl\monks>perl -wMstrict -le "my %fill = ( '\bM(ary)\b' => 'G$1', '\bL(arry)\b' => 'B$1', ); ;; my $s = 'Mary has a little lamb, Larry has a big one'; print qq{'$s'}; ;; foreach my $key (keys %fill) { $s =~ s/$key/ qq{qq{$fill{$key}}} /gee; } print qq{'$s'}; " 'Mary has a little lamb, Larry has a big one' 'Gary has a little lamb, Barry has a big one'
Give a man a fish: <%-(-(-(-<
In reply to Re: backreference on hash
by AnomalousMonk
in thread backreference on hash
by marcpascual
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |