- From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 23 Jun 2006 03:53:40 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/perl/modules/W3C/LogValidator/lib/W3C/LogValidator
In directory hutz:/tmp/cvs-serv29963/lib/W3C/LogValidator
Modified Files:
Basic.pm
Log Message:
avoiding perl warnings when HTTPcodes not present in logs
Index: Basic.pm
===================================================================
RCS file: /sources/public/perl/modules/W3C/LogValidator/lib/W3C/LogValidator/Basic.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Basic.pm 22 Jun 2006 05:09:00 -0000 1.14
+++ Basic.pm 23 Jun 2006 03:53:38 -0000 1.15
@@ -141,7 +141,7 @@
my $uri = shift (@uris);
chomp ($uri);
my @result_tmp;
- if ($HTTPcodes{$uri} eq "200")
+ if (!defined $HTTPcodes{$uri})
#(!defined $HTTPcodes{$uri}) or ($HTTPcodes{$uri} eq "") or ( $HTTPcodes{$uri} =~ /^[2-3]/))
{ # This module should ignore requests that resulted in 4XX and 5XX codes
$census++;
@@ -150,7 +150,18 @@
push @result_tmp, "$uri";
push @result, [@result_tmp];
}
- else { print "$uri returned code $HTTPcodes{$uri}, ignoring \n"; }
+ elsif ($HTTPcodes{$uri} eq "200")
+ # should perhaps make a subroutine for that instead of DUPing code
+ {
+ $census++;
+ push @result_tmp, "$census";
+ push @result_tmp, "$hits{$uri}";
+ push @result_tmp, "$uri";
+ push @result, [@result_tmp];
+ }
+ elsif ((defined $HTTPcodes{$uri}) and ($verbose > 1)) {
+ print "$uri returned code $HTTPcodes{$uri}, ignoring \n";
+ }
}
print "Done!\n" if $verbose;
if ($census eq 1) # let's repect grammar here
Received on Friday, 23 June 2006 03:53:51 UTC