Package: wwwstat
Version: 2.0-2
Severity: normal
Tags: patch

Running "/usr/sbin/wwwstat /var/log/apache/access.log" produces a
torrent of warnings, accompanied by advice on the standard way of
avoiding the warning; attached is a patch following its advice.  Or
I suppose you could just take the "-w" off the hashbang line.

-- System Information:
Debian Release: 3.1
Architecture: i386 (i586)
Kernel: Linux 2.6.12.hurakan
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages wwwstat depends on:
ii  perl                          5.8.4-8    Larry Wall's Practical Extraction 

-- no debconf information

-- 
JBR
Ankh kak! (Ancient Egyptian blessing)

--- /usr/sbin/wwwstat.old       2004-11-24 16:16:21.000000000 +0000
+++ /usr/sbin/wwwstat.old       2005-10-01 12:23:47.000000000 +0100
@@ -836,7 +836,7 @@
         return;
     }
 
-    if ($_ = <FILE>)
+    if (defined ($_ = <FILE>))
     {
         if (/^<HTML>/) { &process_summary; }
         else           { &process_log($_); }
@@ -866,11 +866,11 @@
     # The first thing to do is read past the HEAD and crossreferences
     # until we get to the first preformatted section (the totals)
 
-    do { return unless ($_ = <FILE>); } until ($_ eq $StartTag);
+    do { return unless defined ($_ = <FILE>); } until ($_ eq $StartTag);
 
     # Next line should be "Files Transmitted ..." or "Requests Received ..."
 
-    if (($_ = <FILE>) && (/\s(\d+)$/))
+    if (defined ($_ = <FILE>) && (/\s(\d+)$/))
     {
         return unless $1;
         $TotalRequests += $1;
@@ -879,21 +879,21 @@
 
     # Next line should be "Bytes Transmitted ..."
 
-    if (($_ = <FILE>) && (/\s(\d+)$/)) { $TotalBytes += $1; }
+    if (defined ($_ = <FILE>) && (/\s(\d+)$/)) { $TotalBytes += $1; }
     else { warn "Invalid summary file, skipping"; return; }
 
     # We don't care about the rest of the totals
 
     for (;;)                       # Loop through each section
     {
-        do { return unless ($_ = <FILE>); } until (/^$heading_tag/o);
+        do { return unless defined ($_ = <FILE>); } until (/^$heading_tag/o);
 
         next if (/>$PrefixTop /o);       # Skip any Top N sections
 
         if (/$DailyHeader/o || /$OldDailyHeader/o)
         {
-            do { return unless ($_ = <FILE>); } until (/^$table_rule/o);
-            while (($_ = <FILE>) && ($_ ne $EndTag))
+            do { return unless defined ($_ = <FILE>); } until 
(/^$table_rule/o);
+            while (defined ($_ = <FILE>) && ($_ ne $EndTag))
             {
                 if (/\s(\d+)\s+(\d+)\s+\|\s+(\S.*)/) {
                     $date                = $3;         # the date after "|"
@@ -906,8 +906,8 @@
         elsif (/$HourlyHeader/o || /$OldHourlyHeader/o)
         {
             next unless $Do_Hourly;
-            do { return unless ($_ = <FILE>); } until (/^$table_rule/o);
-            while (($_ = <FILE>) && ($_ ne $EndTag))
+            do { return unless defined ($_ = <FILE>); } until 
(/^$table_rule/o);
+            while (defined ($_ = <FILE>) && ($_ ne $EndTag))
             {
                 if (/\s(\d+)\s+(\d+)\s+\|\s+(\S+)/) {
                     $hour                 = $3;        # the hour after "|"
@@ -920,8 +920,8 @@
         elsif (/$DomainHeader/o || /$OldDomainHeader/o)
         {
             next unless $Do_Domain;
-            do { return unless ($_ = <FILE>); } until (/^$table_rule/o);
-            while (($_ = <FILE>) && ($_ ne $EndTag))
+            do { return unless defined ($_ = <FILE>); } until 
(/^$table_rule/o);
+            while (defined ($_ = <FILE>) && ($_ ne $EndTag))
             {
                 if (/\s(\d+)\s+(\d+)\s+\|\s+(\S+)/) {
                     $domain                   = $3;    # the word after "|"
@@ -934,8 +934,8 @@
         elsif (/$SubdomainHeader/o || /$OldSubdomainHeader/o)
         {
             next unless $Do_Subdomain;
-            do { return unless ($_ = <FILE>); } until (/^$table_rule/o);
-            while (($_ = <FILE>) && ($_ ne $EndTag))
+            do { return unless defined ($_ = <FILE>); } until 
(/^$table_rule/o);
+            while (defined ($_ = <FILE>) && ($_ ne $EndTag))
             {
                 if (/\s(\d+)\s+(\d+)\s+\|\s+(\S.*)/) {
                     $subdomain                      = $3;
@@ -948,8 +948,8 @@
         elsif (/$ArchiveHeader/o || /$OldArchiveHeader/o)
         {
             next unless $Do_Archive;
-            do { return unless ($_ = <FILE>); } until (/^$table_rule/o);
-            while (($_ = <FILE>) && ($_ ne $EndTag))
+            do { return unless defined ($_ = <FILE>); } until 
(/^$table_rule/o);
+            while (defined ($_ = <FILE>) && ($_ ne $EndTag))
             {
                 if (/\s(\d+)\s+(\d+)\s+\|\s+(\S.*)/) {
                     $pathkey = &striplink($3);         # the pathkey after "|"
@@ -962,8 +962,8 @@
         elsif (/$IdentHeader/o || /$OldIdentHeader/o)
         {
             next unless $Do_Ident;
-            do { return unless ($_ = <FILE>); } until (/^$table_rule/o);
-            while (($_ = <FILE>) && ($_ ne $EndTag))
+            do { return unless defined ($_ = <FILE>); } until 
(/^$table_rule/o);
+            while (defined ($_ = <FILE>) && ($_ ne $EndTag))
             {
                 if (/\s(\d+)\s+(\d+)\s+\|\s+(\S.*)/) {
                     $ident                  = $3;      # the identity after "|"

Reply via email to