You could always use grep. Note that I changed the print() in blah() to a return, otherwise you'll end up printing an extra value out.:
my $word = 'BLAHBLAH'; print blah(grep{s/BLAH/COW/}$word); sub blah { my $stuff = shift; return "$stuff\n"; }
In reply to Re: Passing results of a substitution to a function
by Coruscate
in thread Passing results of a substitution to a function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |