jeanluca has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I would like to convert the parameter accessable via CGI::param into a hash(assuming I don't know what the keys/names are) What the procedure to do this ?

Cheers
Luca
  • Comment on CGI::param, how to convert parameters into a hash

Replies are listed 'Best First'.
Re: CGI::param, how to convert parameters into a hash
by castaway (Parson) on Oct 19, 2005 at 10:54 UTC
    my %params = $cgi->Vars();

    Note that parameters with multiple values come out as packed strings, see the CGI documentation.

    C.

      How do 'multivalued CGI parameters' show up in an URL, can you give me an example ?

      Cheers
      Luca
        Yup..

        foo?colour=red;colour=blue;colour=green

        For example if you allow multiple selections from an option/select group, then thats what you'll get.

        C.