You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by David Romero <da...@vendingmexico.com> on 2006/04/01 01:47:53 UTC

Add a new param to Apache2::Request

I try to add new param to Apache2::Reques and i have this error

Can't locate object method "add" via package "APR::Request::Param::Table"

this is my code

$req = Apache2::Request->new();
$req->body->add(new_param => "value");

help say this
                     $req->param("foo" => "bar"); # NO: usage error in 2.X
                     $req->args->{foo} = "bar";   # OK: assign to args table
                     $req->body->add(foo => "bar");  # OK: add to body table

                     $req->param->add(foo => "bar"); # NO: this is an 
expensive noop,
                                                     # because the param 
table is
                                                     # generated by 
overlaying $req->args
                                                     # and $req->body.

                     my $params = $req->param;
                     $params->set(foo => "bar"); # OK: sets "foo" entry 
in $params, which
                                                 # is a local (args + 
body) table. Neither
                                                 # $req->args, 
$req->body, nor future calls
                                                 # to $req->param, are 
affected by mods to
                                                 # $params.



What is the error?

thanks on advantage





Unidos por un Mexico Democratico. www.eleccion2006.com


Re: Add a new param to Apache2::Request

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
David Romero wrote:
> I try to add new param to Apache2::Reques and i have this error
> 
> Can't locate object method "add" via package "APR::Request::Param::Table"
> 
> this is my code
> 
> $req = Apache2::Request->new();
> $req->body->add(new_param => "value");

 > $req = Apache2::Request->new($r);


Note $r


-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."