Jonathan Vanasco wrote:
On Oct 26, 2006, at 4:50 PM, Patrick Galbraith wrote:
Hi all,
in mod_perl 1.0, there was $r->param(), for getting the key/values
of a posted form - what happened to this lovely method?
ApacheRequestRec doesn't have a param method that I can see. There
has to be some nice way to get this info.
its kind of weird how you asked the question though-- right mailing
list, wrong application.
$r is Apache2::RequestRec , part of mod_perl
you want an Apache2::Request object, part of libapreq
sub handler {
my $r= shift;
my $apr= Apache2::Request->new( $r , DISABLE_UPLOADS=> 1 );
my $fieldvalue= $apr->param('field');
}
$apr->param does get/post. there are sep. functions for get & post
if you want one of them specifically too.
Jonathan,
Thanks much! I did find Apache2::Request. I'm really a bit lost with all
the changes in mod_perl2 and libapreq2. It seems, at least to me, that
version 1.0 of both seemed a bit more simple and concise whereas now is
a bit scattered as to what modules do what. I don't understand why
libapreq2 is separate from mod_perl. Before, I could do:
sub handler {
my $r = @_;
my $form = $r->param
.... and so on ...
}
Something as basic as obtaining the form parameters seem like something
that not require a separate module. I don't understand why this was
changed. If I was a newbie who had never done mod_perl programming and
had no dogmatic allegiance to perl, I'd be lost, and probably end up
coding in PHP.
I've had to really hunt around for information and hack around to get
things to work. It seems many linux distributions do a poor job of
packaging mod_perl/libapreq2 in such a way that it works out-of-the-box.
I've been doing mostly C/C++ for the past 3 years and maybe that's the
problem!
regards,
Patrick
// Jonathan Vanasco
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -