This is your problem.  Apparently if you call Apache2::Request->new
with an undefined object, it segfaults.

i ran this:

use Apache2::Request;
my $req = Apache2::Request->new($r);
print qq[Content-type: text/html\n\n];
print q[hi];

through registry, and saw

[Sat Jul 12 22:58:58 2008] [notice] child pid 5703 exit signal
Segmentation fault (11)

If you change that to

use Apache2::Request;
my $r = shift;
my $req = Apache2::Request->new($r);
print qq[Content-type: text/html\n\n];
print q[hi];

it should work.  Unfortunately, it looks like the documentation for
ModPerl::Registry is kind of lacking on perl.apache.org, but what is
there is at
http://perl.apache.org/docs/2.0/api/ModPerl/Registry.html

Adam

OK, when I defined $r as you did, it worked. For documentation, I was looking at here: <http://search.cpan.org/~joesuf/libapreq2-2.08/glue/perl/lib/Apache2/Request.pm>

I see you are just printing to standard output, like a CGI script. In the book, it used

   $r->send_http_header('text/plain');
   $r->print("mod_perl rules!\n");

but there are no such methods on $r here in 2.0.

What, prey tell, is the equivalent object? Is there =any= way to get started, like a simple (but working!) program I could look at?

--John

Reply via email to