$ 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
In reply to Re: How to apply modifiers to a substitution via variable?
by johngg
in thread How to apply modifiers to a substitution via variable?
by lokiloki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |