Robert Mathews wrote:
>
> > Parse the CGI GET/POST request, returning CGI variables into %CGI
> > (regardless of the source) in an un-HTTP escaped fashion
>
> How are you going to handle multiple values for the same parameter?
> With CGI.pm, you can say
> @values = $q->param("foo");
>
> Are you going to make the values of %CGI listrefs? That should have
> been spelled out before you froze the RFC. Also, it seems a bit
> inconvenient if you always have to say C<$CGI{bar}[0]> when you just
> want one value.
Two choices as I see it:
1. make a listref only for multiple values:
@name = @{$CGI{name}} if ( ref $CGI{name} eq 'ARRAY' );
2. make it a comma-delimited string:
$name = $CGI{name};
@name = split ',', $name;
The problem arises if your data has commas in it. Then you're hosed. So
door #1 might be the only solution.
But I don't think listrefs are needed in all contexts, since you should
know which elements will likely have multiple values (checkboxes, etc).
But having a direct data access method like %CGI does create this
problem. Shit.
Maybe %CGI is tied. Fast embedded tie, like in Perl 6. :-)
-Nate
- Re: RFC 288 (v2) First-Class CGI Support Adam Turoff
- Re: RFC 288 (v2) First-Class CGI Support Dan Sugalski
- Re: RFC 288 (v2) First-Class CGI Support Nathan Wiger
- Re: RFC 288 (v2) First-Class CGI Support Dan Sugalski
- Re: RFC 288 (v2) First-Class CGI Su... James Mastros
- Re: RFC 288 (v2) First-Class CG... Dan Sugalski
- Re: RFC 288 (v2) First-Class CG... Nathan Wiger
- Re: RFC 288 (v2) First-Class CG... Dan Sugalski
- Re: RFC 288 (v2) First-Class CGI Support James Mastros
- Re: RFC 288 (v2) First-Class CGI Support Robert Mathews
- Re: RFC 288 (v2) First-Class CGI Support Nathan Wiger
- Re: RFC 288 (v2) First-Class CGI Support Robert Mathews
- Re: RFC 288 (v2) First-Class CGI Support Alan Gutierrez
- Re: RFC 288 (v2) First-Class CGI Support Robert Mathews
- Re: RFC 288 (v2) First-Class CGI Support Alan Gutierrez
- Re: RFC 288 (v2) First-Class CGI Su... iain truskett
- Re: RFC 288 (v2) First-Class CG... Alan Gutierrez
- Re: RFC 288 (v2) First-Class CGI Support H . Merijn Brand
- Re: RFC 288 (v2) First-Class CGI Support Adam Turoff
- Re: RFC 288 (v2) First-Class CGI Support Bart Lateur
- Re: RFC 288 (v2) First-Class CGI Support Russ Allbery
