in reply to [perlfunc] does "if" force "grep" into a scalar context?

Yes, if forces grep() into a scalar context, as list context would complicate things horrideously1. So when grep() returns more than 1 match the if suceeds as grep() returns the number of elements which matched true.
HTH

_________
broquaint

1 yes that would be a made up word

  • Comment on Re: [perlfunc] does "if" force "grep" into a scalar context?