#!/usr/bin/perl
push(@INC,"/www/cgi-bin");

# First tell browser that this is an HTML document being printed

print "Content-type:text/html\n\n";

# The following formats the incoming arguments and puts them into the
# vector $FORM.  Access %FORM with variables $FORM{name}.

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $value =~ s/\n/ /g; # replace newlines with spaces
    $FORM{$name} = $value;
}

print <<"EoF";
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
EoF
