Encourage best practice, even though it's a trivial example.
authorRich Bowen <rbowen@apache.org>
Wed, 9 May 2012 01:30:15 +0000 (01:30 +0000)
committerRich Bowen <rbowen@apache.org>
Wed, 9 May 2012 01:30:15 +0000 (01:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1335882 13f79535-47bb-0310-9956-ffa450edef68

docs/cgi-examples/printenv

index f815a7e501966fe31c2d3011c5e0b99d2abd17ce..be74feaa82e9bb540f81816e686ecbfcd80b61b6 100644 (file)
 ##
 ##  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";