in reply to Passing results of a substitution to a function
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing results of a substitution to a function
by Anonymous Monk on Jan 20, 2003 at 23:24 UTC | |
|
Re: Re: Passing results of a substitution to a function
by Anonymous Monk on Jan 20, 2003 at 23:50 UTC |