sub ParseForm
{
my ($buffer, @pairs, $pair, $name, $value);
if ($ENV{'REQUEST_METHOD'} eq "POST")
{ read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }
else
{ $buffer = $ENV{'QUERY_STRING'}; }
@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;
if (defined $FORM{$name}) # vermutlich checkbox
{ $FORM{$name} = $FORM{$name} . ", " . $value; }
else
{ $FORM{$name} = $value; }
}
}