Apache2::Request param repetitions (again)

"Adam Prime" <[email protected]>
Newsgroups gmane.comp.apache.apreq
Message-ID <[email protected]>
I just rain into this issue in the midst of porting some stuff from apreq1
to apreq2.  discussed previously here:
http://marc.theaimsgroup.com/?t=116110072400001&r=1&w=2

quick summary being:

for a request like this: GET /?pub=1&pub=2 HTTP/1.0

@list = $r->param has different results.

in mp1 you get ('pub'), in mp2 you get ('pub','pub').

the last post in that thread suggests using:

my $table = $req->param;
@table_keys = keys %$table;

but that doesn't work either.  What i've finally ended up doing is this:

my $table = $req->param;
my %table_keys = keys %$table;

foreach my $key (keys (%table_keys)) {
...
}

This should probably be documented.

Adam
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.