$query = $ENV{QUERY_STRING}; if (defined($query) && $query ne '') { foreach (split (/&/, $query)) { #change to /[&;]/, right? y/+/ /; s/%(..)/sprintf("%c", hex($1))/ge; # unquote %-quoted #change above to chr hex $1? if (/(\S+)=(.*)/) { # change \S to [^=], I'd say $input{$1} = $2 if ($2 ne ""); #and what if it is? } else { $input{$_}++; } } }