sub ReadParse { local (*in)=@_if @_; local ($i, $loc, $key, $val); #Read in text if($ENV{'REQUEST_METHOD'}eq"GET"){ $in = $ENV{'QUERY_STRING'}; }elsif ($ENV{'REQUEST_METHOD'}eq "POST"){ read(STDIN,$in, $ENV{'CONTENT_LENGHT'}); } @in = split(/&/.$in); foreach $i (0..$#in){ #Convert pluses to spaces $in[$i]=~s/\+//g; #Split in to key and value. ($key, $val)= split(/=/,$in[$i],2);#splits in the first= #Convert%XX from hex numbers to alphanumeric $key=~s/%(..)/pack("c",hex($1))/ge; $val=~s/%(..)/pack("c",hex($1))/ge; #Associate key and value $in{$key}.="\0"if (defined($in{$key})); #\0 is the mulitple separator $in{$key}.=$val; } return 1;#just for fun }