my $foo = 'bar 123 moo cow'; print "$foo\n"; $foo =~ s/(123)/function($1)/e; print "$foo\n"; sub function { my $argument = shift; $argument = "rab"; return $argument; }
In reply to Re: using s/ to not only substitute but also modify text
by waswas-fng
in thread using s/ to not only substitute but also modify text
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |