diff options
author | doy <doy@tozt.net> | 2008-12-06 21:48:56 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2008-12-06 21:48:56 -0500 |
commit | c08637724b51da7117cb1a1d9b49a3e89c14e45e (patch) | |
tree | 4db014edd16fae8afe88b1aa9126f56219cfcdc9 | |
parent | 22dc974bf57926fb29ae2d75f014618b575e47a3 (diff) | |
download | moosex-role-matcher-c08637724b51da7117cb1a1d9b49a3e89c14e45e.tar.gz moosex-role-matcher-c08637724b51da7117cb1a1d9b49a3e89c14e45e.zip |
apparently you can't use grep like that
-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 { |