in reply to clean code

use CGI; my %data = CGI->new( $memory_data )->Vars();

Of course, that assumes there's no key defined twice, or it won't give the same results. (multiple keys will results in a null (\0) seperated list of all possible values, rather than just the last value for the given key). It'll also do URI decoding, so % and + will get converted.