> 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?

Something like that. Not really later handlers, but just later
subroutines. It has to do with the nature of my application.

> 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.

I thought of this but....it seems kind of inefficient.

Anyhow, I came up with a way that works for me. I wrote a wrapper
around Apache2::Request. The wrapper saves any modifications to the
request parameters as object variables, and each time I try to
retrieve a value, my wrapper checks its object variables first, and if
its not there, it tries to retrieve the value from Apache2::Request.
This way is a little bit more efficient than copying all the params
into a hash since params that are not used are never touched.

Thanks for your help Perrin,

Jimmy


On Nov 23, 2007 3:40 PM, Perrin Harkins <[EMAIL PROTECTED]> wrote:
> On Nov 23, 2007 5:57 PM, Jimmy Li <[EMAIL PROTECTED]> wrote:
> > I am using Apache2::Request - APR::Request::Param::Table is just the
> > underlying table used by Apache2::Request.
>
> Sorry, I was thinking you were using the mod_perl API directly.
>
> > 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.
>
> - Perin
>

Reply via email to