I'm running: Apache/2.0.44 (Win32) mod_perl/1.99_09-dev Perl/v5.8.0
I'm toying around with mod_perl handlers. And I've written this silly little app attached below which works partly. My problem is simple:
- I need to get the querystring (and possibly the xform contents as well). And I would like to receive it parsed (in a hash). But when I use $r->args() I get the whole lot in a single variable. And I get hints from doc's lying around that args() is depreciated. How can I get the querystring anno mod_perl 2.0? Do I have to parse it myself?
- The script below leaves a message in apache's error log:
Can't locate object method "request" via package "Apache::RequestRec" at D:/Prosjekt/designs/gear/gear2/Test/Test.pm line 49.
I would guess that I lack a "use Apache::SomeThing;", but I cant figure it out. (Mainly because I cant find references to it in any documentation.)
Any help would be very useful, please. I'm stuck. (Even if you replied with only four lines of perl code :o)
Thanks, Svein
package Test::Test; use strict; use warnings; use Apache::Reload; use Apache::RequestRec; use Apache::RequestIO; use Apache::Const -compile => qw(OK);
sub handler { my $r = shift; $r->content_type('text/plain');
print "mod_perl 2.0 rocks!\n";
my $path_info = $r->path_info(); print "path_info: $path_info\n";
my $method = $r->method(); print "method: $method\n";
my %a = $r->args(); my @b = %a; print "Args " . @b . ": @b\n";
my $content = $r->request(); print "Content: $content\n";
return Apache::OK; } 1;