summaryrefslogtreecommitdiffstats
path: root/docs/cgi-examples/printenv
diff options
context:
space:
mode:
authorRich Bowen <rbowen@apache.org>2012-05-09 03:30:15 +0200
committerRich Bowen <rbowen@apache.org>2012-05-09 03:30:15 +0200
commit62ac0b88ed63fdd684fbef0fd9abae704ba85432 (patch)
treebf1cdf55e1b2751c8d47be0aeae76a9e5838358f /docs/cgi-examples/printenv
parentRebuild (diff)
downloadapache2-62ac0b88ed63fdd684fbef0fd9abae704ba85432.tar.xz
apache2-62ac0b88ed63fdd684fbef0fd9abae704ba85432.zip
Encourage best practice, even though it's a trivial example.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1335882 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/cgi-examples/printenv')
-rw-r--r--docs/cgi-examples/printenv6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/cgi-examples/printenv b/docs/cgi-examples/printenv
index f815a7e501..be74feaa82 100644
--- a/docs/cgi-examples/printenv
+++ b/docs/cgi-examples/printenv
@@ -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";