Get rid of smartmatch
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 12 Sep 2015 13:32:14 +0000 (16:32 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 12 Sep 2015 13:32:14 +0000 (16:32 +0300)
lib/Apache2/AuthzCaps.pm

index 281d3d6f6e3b63eaa9874172ea00f5030901bbc5..8ffaaac79cbc99f995be0d6e8ee596b9aa2877e7 100644 (file)
@@ -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;
                }
        }
 
This page took 0.01124 seconds and 4 git commands to generate.