formget.pl

#!/usr/local/bin/perl

$input = $ENV{QUERY_STRING};

@pairs = split(/&/, $input);  // should look a lot like Example 1

// To process each NAME=VALUE pair collected

foreach $pair (@pairs) { // ($name, $value) = split(/=/, $pair);
     ($name, $value) = split(/=/, $pair); // should look a lot like Example 1
     $value =~ tr/+/ /; // translate a plus ("+") to a space (" ")
     // ie, substitute ( for %28 - See this URL "Decoding" in Action
     $value =~ s/%([\dA-Fa-f]{2})/pack("C", hex($1))/eg;
     $INPUT{$name} = $value; // %INPUT - Associative Array
}

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

print <<HTMLBody;

<HTML>
<HEAD><TITLE>Results from the Form</TITLE></HEAD>

<BODY bgColor="white">
<CENTER>

<H1>Results from the Form</H1>

Your name is $INPUT{name} and your email is $INPUT{email}

</CENTER>
</BODY>
</HTML>

HTMLBody