in reply to Passing results of a substitution to a function
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.
|
|---|