The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/bin/perl
use strict;
use warnings;

$| = 1;
print "Content-type: text/plain\n\n";

if (@ARGV) {
    print "ARGS: ";
    print join(", ", map { $_ = qq{"$_"} } @ARGV);
    print "\n\n";
} else {
    print "No command line arguments passed to script\n\n";
}

for my $key (keys %ENV) {
    print $key, '=', $ENV{$key}, "\n";
}

if ($ENV{CONTENT_LENGTH}) {
    my $len = $ENV{CONTENT_LENGTH};
    my $content;
    while ($len) {
        my $n = sysread(STDIN, $content, $len);
        last unless defined $n;
        $len -= $n;
    }
    print "\nContent\n-------\n$content";
}