Always, always, always
#!/usr/bin/perl -w
use strict;
Then
USEFUL error messages are output
I think the following modified code may help
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
read (STDIN,my($temp), $ENV{'CONTENT_LENGTH'});
my (@pairs) =split(/&/,$temp);
my($item) = "";
my %fields;
foreach $item(@pairs) {
my($key,$content) =split (/=/, $item, 2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>This is a test of the stuffy perl network</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "$fields{tool}\n";
print "$fields{month}\n";
print "$fields{date}, $fields{month}\n";
print "</BODY>\n</HTML>";
Note the declaration of
my %fields before the loop
Hope this helps