1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Files
apache/docs/cgi-examples/printenv
Justin Erenkrantz e4c24da846 Add charset to the painfully old example CGI scripts.
MFC: 111580
Reviewed by: fielding, erikabele, jerenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@151262 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 00:02:26 +00:00

14 lines
294 B
Perl

#!/usr/local/bin/perl
##
## printenv -- demo CGI program which just prints its environment
##
print "Content-type: text/plain; charset=iso-8859-1\n\n";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
}