Yes, you want to use the /e modifier to the substitution like:
$foo =~ s/(123)/function($1)/e;
/J\
In reply to Re: using s/ to not only substitute but also modify text
by gellyfish
in thread using s/ to not only substitute but also modify text
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |