[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: inconsistency between CGI.pm and Apache::Request
From:       Robert Landrum <rlandrum () capitoladvantage ! com>
Date:       2001-10-31 18:32:23
[Download RAW message or body]

>There is some inconsistency between CGI.pm and Apache::Request's
>param() method, especially in handling of multivalued parameter.
>
>  $q = CGI->new;
>  $q->param(foo => qw(a b c));
>  @foo = $q->param('foo');         # ('a', 'b', 'c')
>  $q->param(bar => [ qw(a b c) ]);
>  @bar = $q->param('bar');         # (['a', 'b', 'c'])
>
>  $r = Apache::Request->new(Apache->request);
>  $r->param(foo => qw(a b c));     # die with an error
>  $r->param(bar => [ qw(a b c) ]);
>  @bar = $r->param('bar');         # ('a', 'b', 'c')

Doesn't this have something to do with the way your shorthanding 
Apache::Request?

Try
$r->param('foo',qw(a b c));

It might work... I remember running into this several years ago, and 
never mentioned it.


>Am I the only one who wants consistency between the two?

No.  It's my opinion that CGI.pm is wrong.  Never would an input 
value come out as an arrayref.  And never would you want to store an 
arrayref in something that might be used to generate hidden inputs.

Lincoln can argue with me.

Rob


--
"Only two things are infinite: The universe, and human stupidity. And I'm not
sure about the former." --Albert Einstein

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic