summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/MooseX/Role/Searchable.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/MooseX/Role/Searchable.pm b/lib/MooseX/Role/Searchable.pm
index 8ea13e8..2a58a01 100644
--- a/lib/MooseX/Role/Searchable.pm
+++ b/lib/MooseX/Role/Searchable.pm
@@ -29,6 +29,10 @@ sub _apply_to_matches {
}
my $value = shift;
+ if (!defined($value)) {
+ # they passed in only one argument. assume they are checking identity
+ ($matcher, $value) = ($default, $matcher);
+ }
return $on_match->(sub { $code->($_) }, (grep { $_->match($matcher => $value) } @_));
}