in reply to How to apply modifiers to a substitution via variable?
$ perl -le ' > $str = q{aaabbbaaa}; > $repl = q{$1}; > $str =~ s{a+(b+)a+}{$repl}ee; > print $str;' bbb $
The first e executes the $repl resulting in $1, the second e executes the $1 resulting in whatever was captured, "bbb" here.
Cheers,
JohnGG
|
|---|