in reply to (Ovid) Re: Passing Params
in thread Passing Params

The first code snippet will also fail if there is a parameter without a value, because param() returns an empty list in that case. The list will end up like ('param1' => 'value1', 'param2' => 'param3', 'value3'). That code really just won't work well, unfortunately.

In the second snippet, it's simpler to use an anonymous array: my %hash = map {$_, [$query->param($_)]} @names; The new CGI method for getting a hash of the parameters is Vars(): my %hash = $query->Vars(); However, that uses the cgi-lib approach of joining multiple values with "\0". :/