while(<>) {
    @fields = split(/&/, $_);
    for $i (@fields) {
	($k, $v) = split(/=/, $i);
	# + are spaces (real + are always encoded as %2B)
	$v =~ s/\+/ /g;
	# %xx are hex. perhaps use /i here?
	$v =~ s/%([0-9A-Fa-f][0-9A-Fa-f])/pack("H2","$1$2")/eg;
	$content{$k} = $v;
	print "$k set to $v\r\n";
    }
}
