From: Marius Gavrilescu Date: Sat, 12 Sep 2015 13:32:14 +0000 (+0300) Subject: Get rid of smartmatch X-Git-Tag: 0.002~4 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=139b349117794fae33d5132b9dd97a0f9ab03ee6;p=apache2-authzcaps.git Get rid of smartmatch --- diff --git a/lib/Apache2/AuthzCaps.pm b/lib/Apache2/AuthzCaps.pm index 281d3d6..8ffaaac 100644 --- a/lib/Apache2/AuthzCaps.pm +++ b/lib/Apache2/AuthzCaps.pm @@ -4,7 +4,7 @@ use 5.014000; use strict; use warnings; use subs qw/OK DECLINED/; -no if $] >= 5.017011, warnings => 'experimental::smartmatch'; + our $VERSION = '0.001001'; use if $ENV{MOD_PERL}, 'Apache2::Access'; @@ -47,15 +47,10 @@ sub handler{ local $rootdir = $r->dir_config('AuthzCapsRootdir'); if ($user) { - LOOP: for my $requirement (map { $_->{requirement} } @{$r->requires}) { + for my $requirement (map { $_->{requirement} } @{$r->requires}) { my ($command, @args) = split ' ', $requirement; - given ($command){ - when('cap'){ - return OK if hascaps $user, @args - } - - } + return OK if $command eq 'cap' && hascaps $user, @args; } }