summaryrefslogtreecommitdiffstats
path: root/rubbos/app/httpd-2.0.64/docs/cgi-examples/printenv
blob: e4c2140bcff5e382ee37b6df99971b641d4e5987 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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";
}