]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix: Work with Perl 5.14
authoreldy <>
Wed, 17 Oct 2012 11:11:05 +0000 (11:11 +0000)
committereldy <>
Wed, 17 Oct 2012 11:11:05 +0000 (11:11 +0000)
test/test.pl
wwwroot/cgi-bin/awstats.pl

index a2ba51c1e2fe7e1403cfd7b1840c11daa075ec3b..ed7661237797b8e9664dc09aa9cf13bd2be640a3 100644 (file)
@@ -76,9 +76,8 @@ $PERL="perl";
 #@TESTLIST=("testpostfix4");
 #@TESTLIST=("testexchange");
 #@TESTLIST=("testwebstar");
-$OPTION="-staticlinks";
-$OPTION="-staticlinks -showdropped -showcorrupted -debug=1";
-#$OPTION="-staticlinks -showdropped -showcorrupted";
+$OPTIONNODEBUG="-staticlinks -showdropped -showcorrupted -debug=0";
+$OPTIONDEBUG="-staticlinks -showdropped -showcorrupted -debug=4";
 $YEARMONTH="-month=01 -year=2001";
 #$YEARMONTH="-month=12 -year=2003";
 
@@ -130,14 +129,22 @@ while(1==1)
                foreach (grep /^awstats\d\d\d\d\d\d\.$test\.txt$/, sort readdir DIR) { unlink "$DIRRESULT/$_"; }
                closedir(DIR);
        
-               $command="$PERL \"$DIRAWSTATS/awstats.pl\" $OPTION -config=$test > \"$DIRRESULT/result_${test}_update.html\"";
+               $command="$PERL \"$DIRAWSTATS/awstats.pl\" $OPTIONDEBUG -config=$test > \"$DIRRESULT/result_${test}_update_debug.html\"";
                print "$command 2>&1\n";
                $ret=`$command  2>&1`;
        #       print "$ret\n";
-               $command="$PERL \"$DIRAWSTATS/awstats.pl\" $OPTION -config=$test $YEARMONTH -output".($OPTIONOUTPUT?"=$OPTIONOUTPUT":"")." > \"$DIRRESULT/result_${test}.html\"";
+        $command="$PERL \"$DIRAWSTATS/awstats.pl\" $OPTIONNODEBUG -config=$test > \"$DIRRESULT/result_${test}_update.html\"";
+        print "$command 2>&1\n";
+        $ret=`$command  2>&1`;
+    #   print "$ret\n";
+               $command="$PERL \"$DIRAWSTATS/awstats.pl\" $OPTIONDEBUG -config=$test $YEARMONTH -output".($OPTIONOUTPUT?"=$OPTIONOUTPUT":"")." > \"$DIRRESULT/result_${test}_debug.html\"";
                print "$command 2>&1\n";
                $ret=`$command`;
        #       print "$ret\n";
+        $command="$PERL \"$DIRAWSTATS/awstats.pl\" $OPTIONNODEBUG -config=$test $YEARMONTH -output".($OPTIONOUTPUT?"=$OPTIONOUTPUT":"")." > \"$DIRRESULT/result_${test}.html\"";
+        print "$command 2>&1\n";
+        $ret=`$command`;
+    #   print "$ret\n";
        
                `rm "$DIRAWSTATS/awstats.$test.conf"`;
        
index 15452714b97023a6d9f47cad4668cc234bf5d2b2..942b9616a02b93a0e531a0ecb77b4a92ece346be 100644 (file)
@@ -1351,9 +1351,7 @@ sub debug {
 #------------------------------------------------------------------------------
 sub OptimizeArray {
        my $array = shift;
-       my @arrayunreg = map {
-               if (/\(\?[-\w]*:(.*)\)/) { $1 }
-       } @$array;
+       my @arrayunreg = map { UnCompileRegex($_) } @$array;
        my $notcasesensitive = shift;
        my $searchlist       = 0;
        if ($Debug) {
@@ -7813,7 +7811,8 @@ sub DecodeEncodedString {
 # Return:              standardregex
 #------------------------------------------------------------------------------
 sub UnCompileRegex {
-       shift =~ /\(\?[-\w]*:(.*)\)/;
+       shift =~ /\(\?[-^\w]*:(.*)\)/;         # Works with all perl
+       # shift =~ /\(\?[-\w]*:(.*)\)/;        < perl 5.14
        return $1;
 }