Hey mod_perl users/developers,

In short what I think we need is for the modperl2 perl-script
configuration directive to automagically load the Apache::compat
layer, please read below for why.

----

I am working on the Hello World benchmarks to get them running
against mod_perl2 so we can get some numbers comparing mod_perl1
against it, and meanwhile having to port to Apache2/mod_perl2
for the first time, in this case all of the benchmarks.

What struck me odd was that even the simplest of handlers would
not run directly under mod_perl/1.99_05-dev, as in:

sub handler {
     my($r) = shift;
     $r->content_type('text/html');
     $r->send_http_header();
     $r->print('Hello ');
     $r->print('World');
     200;
}

In this case the error was about content_type() not being implemented
which I could fix by adding:

use Apache::compat;

If it is the case that even the most trivial of applications
need Apache::compat, then why not load the Apache::compat layer
automatically?  If performance is an issue, or code bloat or
what not, then perhaps *Apache::compat* layer could be added
only in case of using the *perl-script* config directive,
instead of the new modperl directive.

With the differences between the new modperl directive & perl-script,
it is clear that the latter is meant for backwards compatibility anyway, so
why not go the extra mile & load Apache::compat?  At the very least, it
will probably save the thousands of mod_perl modules out there from
having to add that one "Apache::compat" line to their code.
& its not even that easy, in that to keep backwards compatibility
with old modperl 1.x code, we have to add

   eval "use Apache::compat;"

instead!  I am actually already doing this now for the modules
that I am trying to get to work with both mod_perl1 and mod_perl2

Thanks for the great work so far, and benchmarks will be forthcoming.

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checking                http://www.nodeworks.com

Reply via email to