You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2012/05/09 03:30:15 UTC
svn commit: r1335882 - /httpd/httpd/trunk/docs/cgi-examples/printenv
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";