From 139b349117794fae33d5132b9dd97a0f9ab03ee6 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 12 Sep 2015 16:32:14 +0300 Subject: [PATCH] Get rid of smartmatch --- lib/Apache2/AuthzCaps.pm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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; } } -- 2.39.2