Hi,
I'm still struggling with trying to understand how Mod_Perl 2 works. All I want to do is to have a regular Perl script run under Mod_Perl just to speed it up.
In the past, in Mod_Perl 1 I’ve used this:
sub PrintHeader { if ($ENV{'PERL_SEND_HEADER'}) { print "Content-type: text/html\r\n\r\n"; } else { my $r = Apache->request; $r->content_type('text/html'); $r->send_http_header; } }
I then read the documentation where it says:
Apache->request has been replaced with Apache2::RequestUtil::request( ).
There is also some other documentation in that section that I don’t quite understand. In testing and messing around with this in Mod_Perl 2 I’ve noticed that the simple
print "Content-type: text/html\r\n\r\n";
just works. My Apache configuration looks like this:
<Directory C:\Apache2\Apache2\htdocs\develop> Options ExecCGI AddHandler cgi-script .pl AddHandler cgi-script .cgi
#For ModPerl Only <IfModule mod_perl.c> <Files ~ (\.pl)> SetHandler perl-script PerlResponseHandler ModPerl::Registry Options ExecCGI allow from all PerlOptions +ParseHeaders </Files> </IfModule> </Directory>
I’m thrilled if:
print "Content-type: text/html\r\n\r\n";
just works. But I want to make sure I understand it and that it is OK before releasing this.
I’m just using ModPerl::Registry to speed regular Perl CGI scripts up. The code needs to work with regular CGI, Mod_Perl 1, Mod_Perl 1.99, and Mod_Perl 2.
And by the way $ENV{'PERL_SEND_HEADER'} does not seem to exist any more. Is this not available in Mod_Perl 2? How do detect:
PerlOptions -ParseHeaders?
Thanks for your help,
Justin |
- Do I need Apache2::RequestUtil::request( )? Justin Luster
- Re: Do I need Apache2::RequestUtil::request( )? Foo Ji-Haw
- Re: Do I need Apache2::RequestUtil::request( )? Tom Schindl
- RE: Do I need Apache2::RequestUtil::request( )? Justin Luster
- Re: Do I need Apache2::RequestUtil::request( )? Tom Schindl
- RE: Do I need Apache2::RequestUtil::request... Justin Luster