summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd/cgi-bin/printenv
blob: bb91d2b394bc684995f8f47f4f37af13e1296967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl
##
##  printenv -- demo CGI program which just prints its environment
##

print "Content-type: text/plain\n\n";
foreach $var (sort(keys(%ENV))) {
    $val = $ENV{$var};
    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;
    print "${var}=\"${val}\"\n";
}