diff options
-rw-r--r-- | lib/MooseX/Role/Matcher.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/MooseX/Role/Matcher.pm b/lib/MooseX/Role/Matcher.pm index cdd9812..d614ff5 100644 --- a/lib/MooseX/Role/Matcher.pm +++ b/lib/MooseX/Role/Matcher.pm @@ -35,8 +35,8 @@ method each_match => sub { method grep_matches => sub { my $class = shift; - # XXX: can you use grep like this? - $class->_apply_to_matches(\&grep, sub { $_->match(@_) }, @_); + my $grep = sub { my $code = shift; grep { $code->($_) } @_ }; + $class->_apply_to_matches($grep, sub { $_->match(@_) }, @_); }; method any_match => sub { |