The canonical way of finding out whether a module of yours is being called in a mod_perl environment, appears to be (thanks Stas!):

 use constant MP => $ENV{MOD_PERL}
     ? eval { require mod_perl;  $mod_perl::VERSION >= 1.99 ? 2 : 1 } : 0;

giving:

 - 0 not in mod_perl
 - 1 in mod_perl 1, prefork MPM implied
 - 2 in mod_perl 2, but with which MPM?


In order to be able to do some optimizations at load time, I would like to be able to find out whether mod_perl is running with a prefork MPM (so that it makes sense to load as much as possible before children are forked).


So is there a way to find out whether a prefork MPM is being used in mod_perl while running a Perl script?


Liz


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to