httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbo...@apache.org
Subject svn commit: r1335882 - /httpd/httpd/trunk/docs/cgi-examples/printenv
Date Wed, 09 May 2012 01:30:15 GMT
Author: rbowen
Date: Wed May  9 01:30:15 2012
New Revision: 1335882

URL: http://svn.apache.org/viewvc?rev=1335882&view=rev
Log:
Encourage best practice, even though it's a trivial example.

Modified:
    httpd/httpd/trunk/docs/cgi-examples/printenv

Modified: httpd/httpd/trunk/docs/cgi-examples/printenv
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/cgi-examples/printenv?rev=1335882&r1=1335881&r2=1335882&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/cgi-examples/printenv (original)
+++ httpd/httpd/trunk/docs/cgi-examples/printenv Wed May  9 01:30:15 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";



Mime
View raw message