If multiple values are detected in the url(foo=1&foo=2&foo=3), create an
additional entry in the returned hash of the form "&foo", which is a
reference to a list, and push all values found onto it. "foo" in the
returned hash has the last value found, in this case, "3".
($key, $val) = split(/=/,$_,2);
$key=~s/%(..)/pack("c",hex($1))/ge;
$val=~s/%(..)/pack("c",hex($1))/ge;
+ if ( exists $ret{$key} ) {
+ if ( !exists $ret{"&$key"} ) {
+ $ret{"&$key"} = [ $ret{$key} ];
+ }
+ push @{$ret{"&$key"}},$val;
+ }
$ret{$key}=$val;
}
$debug = 1 if (defined $ret{"debug"} && $ret{"debug"} eq "aj");