use CGI; my $query = CGI->new; my @names = $query->param; my %hash = map { $_, $query->param( $_ ) } @names;