The usual idiom is:
If you want to combine it with calling a function, use Perls do:($tmp = $string) =~ s/foo/blah/;
Orfunc do {(my $tmp = $string) =~ s/foo/blah; $tmp};
func do {local $_ = $string; s/foo/blah; $_};
-- Abigail
In reply to Re: Non-destructive substitution?
by Abigail
in thread Non-destructive substitution?
by Sprad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |