in reply to Re: Passing results of a substitution to a function
in thread Passing results of a substitution to a function

Ok - I now have something which works a lot more niftily:
my $word = 'BLAHBLAH' blah(grep {s/BLAH/COW/ || 1 } $word);
The { s/BLAH/COW/ || 1 } bit is required as I want to also pass in arguments which do not contain 'BLAH' (which grep would usually.. er.. grep away ;) ). I was worried about list context before because I was trying to get around this by using
blah(grep(s/BLAH/COW/,$word)||$word)