in reply to Re: Use of grep with arrays/hashes
in thread Use of grep with arrays/hashes

Of the two bad idioms, abusing map is worse because if your function returns multiple values per term and you are on any Perl before 5.6.1, the effort of constructing the return list is quadratic.

But map and grep work out the same in this case, and the potential difference is largely irrelevant because both run more slowly than simple looping and waste more memory while they are at it. So use a loop.

  • Comment on Re (tilly) 2: Use of grep with arrays/hashes