From c08637724b51da7117cb1a1d9b49a3e89c14e45e Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 6 Dec 2008 21:48:56 -0500 Subject: apparently you can't use grep like that --- lib/MooseX/Role/Matcher.pm | 4 ++-- 1 file 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 { -- cgit v1.2.3-54-g00ecf