Apache: avoid undefinedness warning without PLPcache
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 29 Sep 2014 19:58:00 +0000 (19:58 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 31 Mar 2018 20:58:53 +0000 (22:58 +0200)
Same results but without potentially clogging error logs with:

> Use of uninitialized value in pattern match (m//)

lib/PLP/Backend/Apache.pm

index 6964b56412ca45efb56c8954bb00d76e8458ec3d..cd5b16f34ce92367f2c56d33eb3c910083dd4ccc 100644 (file)
@@ -45,7 +45,7 @@ sub init {
        
        $ENV{PLP_NAME} = $r->uri;
 
-       $PLP::use_cache = $r->dir_config('PLPcache') !~ /^off$/i;
+       $PLP::use_cache = ($r->dir_config('PLPcache') || 'on') !~ /^off$/i;
 #S     $PLP::use_safe  = $r->dir_config('PLPsafe')  =~ /^on$/i;
        my $path = $r->filename();
        my ($file, $dir) = File::Basename::fileparse($path);