diff options
author | Rich Bowen <rbowen@apache.org> | 2012-05-09 03:30:15 +0200 |
---|---|---|
committer | Rich Bowen <rbowen@apache.org> | 2012-05-09 03:30:15 +0200 |
commit | 62ac0b88ed63fdd684fbef0fd9abae704ba85432 (patch) | |
tree | bf1cdf55e1b2751c8d47be0aeae76a9e5838358f /docs/cgi-examples/printenv | |
parent | Rebuild (diff) | |
download | apache2-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/printenv | 6 |
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"; |