grep is your friend
Grep is another Perl's great built in function, one of the things I use it most is to check if I can find an element on a list. For example, instead of something like
my $found = 0;
foreach (@list) {
$search eq $_ and $found++;
}
I prefer to use something like:
my $found = grep {$search eq $_} @list;
Code is simpler and more elegant, there's no significant performance from using one or another, although grep seems to actually run faster if you want to squeeze all the crumbs:
find_with_for 28818/s …