Now that I am using a server without mp1, I noticed that I cannot perl -c my
startup.pl because it uses AuthDBI and AuthDBI looks for MP1 files if I'm
not running under MP2.
Since I'm not running under MP2 for the perl -c check, I commented the if
block to just load Apache2:Const.
use constant MP2 => $ENV{MOD_PERL_API_VERSION} == 2 ? 1 : 0;
BEGIN {
my @constants = qw( OK AUTH_REQUIRED FORBIDDEN DECLINED SERVER_ERROR );
#if (MP2) {
require Apache2::Const;
import Apache2::Const @constants;
#}
#else {
# require Apache::Constants;
# import Apache::Constants @constants;
#}
}
I'm thinking something better would be:
if (MP2 or ($ENV{'GATEWAY_INTERFACE'} eq '' && -f
/usr/local/lib/perl5/site_perl/5.8.6/i686-linux/Apache2/Const.pm)
However, my question is what's the best way to check for the existance of
Const.pm? Sort of like an PREREQ_PM 'Apache2::Const' => 1 test?
Regards,
KAM