<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">sub parseform {
    local($formthing) = @_;	# Expects something like:
				# foo=wow%21&amp;bar=hello&amp;baz=blah

    (@fields) = split('&amp;', $formthing);
    for $f (@fields){

	($name, $value) = split('=', $f);
	    $value =~ y/\+/ /;
	$value =~ s/%([\da-f]{1,2})/pack(C,hex($1))/eig; # remove % escapes
        if(defined $lookup{$name}){
            $lookup{$name} .= "\n".$value;
	    }
	else{
          $lookup{$name} = $value;
    }
    }

    %lookup;
}
1;
</pre></body></html>