You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Carl Brewer <ca...@bl.echidna.id.au> on 2005/05/22 02:51:47 UTC
[mp2] porting older mp2 code to 2.0.0 - I'm stuck with params from
apreq!
I'm porting my code to mp2.0.0 from 1.99.older (16?) - so
far mostly ok, but I'm stuck on a conversion with
apreq - I've now got libapreq2-2.05-dev installed (the
distributed version, not sucked from svn/cvs).
I was using the following code to grab input :
sub hash_post {
# returns a hash of all the POST values
use Apache::Request;
my ($r) = shift;
my %rethash = {};
my $req = Apache::Request->new($r);
my @param_names = $req->param;
foreach my $value (@param_names) {
$rethash{$value} = $req->param($value);
}
return %rethash;
}
It's crude, but it worked with mp1.99 and libapreq 2.04-dev.
I've been floundering around with libapreq 2.05-dev
tryin to get at the params, but I don't really know
what I'm doing - and I haven't been able to find any
simple examples in the apreq code - save for some
pretty hairy stuff in glue/perl/t/apreq/cgi.t, but isn't
apreq supposed to hide all that bucket brigade stuff? I
just want the params from my POST and GET requests!
Can anyone suggest what simple change I need to make to the
above to get it working with mp2.0.0/libapreq-2.05-dev?
thanks!
Carl
Re: [mp2] porting older mp2 code to 2.0.0 - I'm stuck with params
from apreq!
Posted by Cure <cu...@cureable.com>.
Carl Brewer wrote:
> Carl Brewer wrote:
>
>>
> Apache2::RequestUtil->request($r).;
> If I'd looked in :
> docs/html/group__apreq__xs__request.html
>
> I'd have seen that all I needed to do was to
> change
>
> use Apache::Request;
> to
> use Apache2::Request;
>
> and
> my $req = Apache::Request->new($r);
> to
> my $req = Apache2::Request->new($r);
>
> and it would have just worked!
>
>
> Mea Culpa
>
> Carl
>
>
Re: [mp2] porting older mp2 code to 2.0.0 - I'm stuck with params
from apreq!
Posted by Carl Brewer <ca...@bl.echidna.id.au>.
Carl Brewer wrote:
>
If I'd looked in :
docs/html/group__apreq__xs__request.html
I'd have seen that all I needed to do was to
change
use Apache::Request;
to
use Apache2::Request;
and
my $req = Apache::Request->new($r);
to
my $req = Apache2::Request->new($r);
and it would have just worked!
Mea Culpa
Carl