httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1364713 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS docs/cgi-examples/printenv support/split-logfile.in
Date Mon, 23 Jul 2012 17:06:06 GMT
Author: rjung
Date: Mon Jul 23 17:06:05 2012
New Revision: 1364713

URL: http://svn.apache.org/viewvc?rev=1364713&view=rev
Log:
Encourage best practice in Perl scripts (use strict, warnings).

Backport of r1335882 and r1325724 from trunk.

Submitted by: rbowen
Reviewed by: rjung, humbedooh
Backported by: rjung

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/docs/cgi-examples/printenv
    httpd/httpd/branches/2.4.x/support/split-logfile.in

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1325724,1335882

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1364713&r1=1364712&r2=1364713&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Mon Jul 23 17:06:05 2012
@@ -8,6 +8,8 @@ Changes with Apache 2.4.3
      possible XSS for a site where untrusted users can upload files to
      a location with MultiViews enabled. [Niels Heinen <heinenn google.com>]
 
+  *) Add "strict" and "warnings" pragmas to Perl scripts.  [Rich Bowen]
+
   *) Honor DefaultRuntimeDir for mutexes, socache and CGID socket.
      [Jim Jagielski]
 

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1364713&r1=1364712&r2=1364713&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Mon Jul 23 17:06:05 2012
@@ -135,12 +135,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
      +1: trawick, jorton, rjung
      +1 before r1364601 was added: jim
 
-   * docs+support: Encourage best practice in Perl scripts (use strict, warnings).
-     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1335882 and
-                  http://svn.apache.org/viewvc?view=revision&revision=1325724
-     2.4.x patch: trunk patch works
-     +1: rjung, humbedooh, rbowen
-
    * apxs: Make apxs use LDFLAGS from config_vars.mk in addition to
      CFLAGS and CPPFLAGS.
      trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1343094

Modified: httpd/httpd/branches/2.4.x/docs/cgi-examples/printenv
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/cgi-examples/printenv?rev=1364713&r1=1364712&r2=1364713&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/cgi-examples/printenv (original)
+++ httpd/httpd/branches/2.4.x/docs/cgi-examples/printenv Mon Jul 23 17:06:05 2012
@@ -11,10 +11,12 @@
 ##
 ##  printenv -- demo CGI program which just prints its environment
 ##
+use strict;
+use warnings;
 
 print "Content-type: text/plain; charset=iso-8859-1\n\n";
-foreach $var (sort(keys(%ENV))) {
-    $val = $ENV{$var};
+foreach my $var (sort(keys(%ENV))) {
+    my $val = $ENV{$var};
     $val =~ s|\n|\\n|g;
     $val =~ s|"|\\"|g;
     print "${var}=\"${val}\"\n";

Modified: httpd/httpd/branches/2.4.x/support/split-logfile.in
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/split-logfile.in?rev=1364713&r1=1364712&r2=1364713&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/support/split-logfile.in (original)
+++ httpd/httpd/branches/2.4.x/support/split-logfile.in Mon Jul 23 17:06:05 2012
@@ -26,22 +26,25 @@
 # The combined log file is read from stdin. Records read
 # will be appended to any existing log files.
 #
-%is_open = ();
+use strict;
+use warnings;
 
-while ($log_line = <STDIN>) {
+my %is_open = ();
+
+while (my $log_line = <STDIN>) {
     #
     # Get the first token from the log record; it's the
     # identity of the virtual host to which the record
     # applies.
     #
-    ($vhost) = split (/\s/, $log_line);
+    my ($vhost) = split (/\s/, $log_line);
     #
     # Normalize the virtual host name to all lowercase.
     # If it's blank, the request was handled by the default
     # server, so supply a default name.  This shouldn't
     # happen, but caution rocks.
     #
-    $vhost = lc ($vhost) or "access";
+    $vhost = lc ($vhost) || "access";
     #
     # if the vhost contains a "/" or "\", it is illegal so just use 
     # the default log to avoid any security issues due if it is interprted



Mime
View raw message