From: eldy <> Date: Wed, 17 Oct 2012 11:11:05 +0000 (+0000) Subject: Fix: Work with Perl 5.14 X-Git-Tag: AWSTATS_7_1~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6fcdf3b48a794cb191dfb42f34f0d521bc234a2a;p=thirdparty%2FAWStats.git Fix: Work with Perl 5.14 --- diff --git a/test/test.pl b/test/test.pl index a2ba51c1..ed766123 100644 --- a/test/test.pl +++ b/test/test.pl @@ -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"`; diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 15452714..942b9616 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -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; }