Can you do: my %foo = $cgi->param("foo")

Else, how do you loop thru to put the array into %keys?

--Tee
On Feb 8, 2005, at 7:40 PM, Ovid wrote:

--- "Scott R. Godin" <[EMAIL PROTECTED]> wrote:

his example and in which case you want to get the params AFTER
creating
the cgi-object

my %params = $cgi->Vars;

which ensures that you also get multi-value <select>s as separate
values. too.

$cgi->Vars separates multiple values with a null byte, thus increasing the risk of the person using this being vulnerable to a null-byte hack. I would only use this if you're migrating from the Perl 4 cgi-lib.pl.


Also. having to do "@foo = split "\0",$params->{foo};" is not fun and it's easy to get wrong.

If someone needs multiple values, they should just take advantage of
list context:

  my $foo = $cgi->param('foo'); # single value
  # versus
  my @foo = $cgi->param('foo'); # multiple values

Cheers,
Ovid

=====
If this message is a response to a question on a mailing list, please send
follow up questions to the list.


Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to