Stas Bekman wrote:
Apache::compat is useful during the mp1 code porting. Though remember that it's implemented in pure Perl. In certain cases it overrides mp2 methods, because their API is very different and doesn't map 1:1 to mp1. So if anything, not under my control, loads Apache::compat my code is forced to use the potentially slower method. Which is quite bad.

Some users may choose to keep using Apache::compat in production and it may perform just fine. Other users will choose not to use that module. It should be users' choice.

Therefore CPAN modules should *not* preload Apache::compat, but use the mp2 API or copy the relevant parts from Apache::compat.

Of course one can add an ugly workaround in startup.pl:

$INC{'Apache/compat.pm'} = __FILE__;

but I'd rather not have to remember doing that. I'll update the manpage to have this warning.

I haven't scanned the CPAN modules yet, but I've noticed that CGI.pm's latest version does:

    require mod_perl;
    if ($mod_perl::VERSION >= 1.99) {
      eval "require Apache::compat";
    } else {
      eval "require Apache";
    }

Lincoln, any chance we can kill that preloading? If you need help with porting the API please let us know.

Here is a hopefully useful discussion and examples on how to get rid of Apache::compat:
http://perl.apache.org/docs/2.0/devel/porting/porting.html#Handling_Missing_and_Modified_mod_perl_1_0_APIs


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to