my $word = 'BLAHBLAH' blah(grep {s/BLAH/COW/ || 1 } $word); #### blah(grep(s/BLAH/COW/,$word)||$word)