Hash-Search reviews

RSS | Module Info

Hash-Search (0.03)

my %fruits = qw(one orange two banana three apple four pear five pineapple);
my %results = map { $_ => $fruits{$_} } grep { /e$/ } keys %fruits;
my $count = keys %results;

This is all the module does, but with no discernable advantage over doing it with just the built-ins. The method names repeat the class type unnecessarily and therefore are longer to type than need be. The documentation specifies that the first parameter to hash_search is a regular expression, but the examples show a string type scalar instead. Since there is no type check for this parameter and it is simply interpolated by the m operator, this only works by coincidence.