in reply to Re^2: Hash search and returning by value
in thread Hash search and returning by value

Without parens on the LHS you'll call grep in scalar context and get the number of matches returned.

Only 0 matches is false.

But you should really take reverse into consideration to create an inverted hash.

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

  • Comment on Re^3: Hash search and returning by value