> -----Original Message-----
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 08, 2002 11:32 AM
> To: 'Josiah Altschuler'; '[EMAIL PROTECTED]'
> Subject: RE: passing a hash using cgi.pm
> 
> Something like this should work, letting CGI.pm do the work
> for you:
> 
>    my $query = CGI->new({request => [%clusArrayHash[1]]})->query_string;

Rats, that should be:

my $query = CGI->new({request => [%{$clusArrayHash[1]}]})->query_string;

Which means:

   $clusArrayHash[1]       is a hashref
   %{$clusArrayHash[1]}    is the hash
   [%{$clusArrayHash[1]}]  is a ref to an anonymous array containing
                           the hash "unrolled" to a list

The arg to CGI->new() is a hashref to a set of parameter key/value
pairs. When you use a listref as a parameter value, the query string
will be constructed to properly return the parameter as a list from
the param() call, so you can assign it back to a hash.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to