#!/opt/default/bin/perl -w

my %params;

read(STDIN, $q, $ENV{CONTENT_LENGTH});
parse($q);

print <<END;
Content-Type: text/html

<html>
<body bgcolor=white>
query = $q
<p>
params = "%params\n";
END

sub parse {
	my @pairs = split('&', @_);
	my($par, $val);

	foreach (@pairs) {
		($par, $val) = split('=');
		# unescape
		if ($params{$par}) {
			$params{$par} .= "$;$val";
		} else {
			$params{$par} = $val;
		}
	}
	return %params
}
