#!/usr/bin/perl # use strict; print "Content-Type: text/html\n\n"; print "dump output\n"; if ($ENV{'REQUEST_METHOD'} eq "GET") { my $in = $ENV{'QUERY_STRING'}; print "

REQUEST_METHOD was GET

\n";
    print "Stdin= [$in]\n";
    print "
\n"; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { my $in; sysread(STDIN, $in, $ENV{'CONTENT_LENGTH'}); print "

REQUEST_METHOD was POST

\n";
    print "Stdin= [$in]\n";
    print "
\n"; } print "

Environment variables

\n";
foreach my $key (sort(keys(%ENV))){
    print "$key", " "x(23-length($key)), "= $ENV{$key}\n";
}

print "
\n"; print "\n"; exit 0;