#!/usr/bin/perl -w use strict; # A simple CGI-script for testing purposes. # Written by Paul Rombouts
EOF
;
if(@ARGV) {
print "my args are: @ARGV\n\n\n";
}
else {
print "I have no arguments.\n\n\n";
}
print "my CGI environment variables are:\n\n";
foreach my $key (@CGIvarnames) {
print($key,defined($ENV{$key})?"=$ENV{$key}":" is undefined","\n");
}
print "\n";
foreach my $key (keys %ENV) {
if($key =~ /^HTTP_/) {
print "$key=$ENV{$key}\n";
}
}
if(defined(my $length=$ENV{CONTENT_LENGTH})) {
print "\n\n";
my $content;
my $res=sysread(STDIN,$content,$length);
if(defined($res)) {
print("my",($res<$length)?" (incomplete) ":" ","content is:\n\n",$content);
}
else {
print "An error occurred while tring to read my content: $!\n";
}
}
print << "EOF"
EOF ; exit 0;