For the second issue generally /e (evaluate) is used, but you need it twice. Remember to quote the $ in the string for $replace, or use single quotes so Perl doesn't try to interpolate $1:
my $replace = '$1'; $string =~ s/a+(b+)a+/$replace/eeg;
In reply to Re: How to apply modifiers to a substitution via variable?
by GrandFather
in thread How to apply modifiers to a substitution via variable?
by lokiloki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |