You could do this ... whether you should is for your own concience:)
sub blah{print +shift;} my $word = 'BLAHBLAH'; blah( do{ (local $_= $word) =~ s/BLAH/COW/g; $_} ); # prints COWCOW print $word; # prints BLAHBLAH
Examine what is said, not who speaks.
The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.
In reply to Re: Passing results of a substitution to a function
by BrowserUk
in thread Passing results of a substitution to a function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |