in reply to Re^3: Pattern match array
in thread Pattern match array
Thanks, this is of interest.
I think if I had known benchmarks would be run, I would have hashed instead of grepping.
my %sought = map {$_ => 1} @prims;and later
if ($sought{$word})And then there's List::MoreUtils::any, which would at least quit on the first match instead of checking the rest of the list.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Pattern match array
by johngg (Canon) on May 09, 2008 at 13:56 UTC |