Perrin Harkins wrote:
>> Get the request parameters using the tied APR::Request::Param::Table
object (which is returned by Apache2::Request->new($r)->param in
scalar context) as well as being able to modify the request parameters
in the tied APR::Request::Param::Table object.
Yes, but why? That is simply a record of data that was in the
request. You can't change the past. What are you really trying to
do? Store some data for a later handler?
The docs warn that you can't change these parameters in a way that is
visible to anyone else:
"Note: modifications to the scalar $req->param() table only affect the
returned table object (the underlying C apr_table_t is generated from
the parse data by apreq_params()). Modifications do not affect the
actual request data, and will not be seen by other libapreq2
applications."
If all you want to do is change them around in some sub as you do work
on them, copy them all into local variables and do whatever you like
with them. You can copy them into a hash of array refs to preserver
multiple values.
The rub here for me is that in apreq1 you could modify param just fine,
but that in apreq2 you cannot. None of the porting documents mention
this unfortunately.
What I ultimately did to get around this was modify the param scrubbing
code that wanted to modify param so that what it created a new instance
of an APR::Table, which does implement STORE when tied, and put
everything in there.
Adam