perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <>
Subject Re: issues with figuring out which mp version is running
Date Sun, 22 Jan 2006 19:06:46 GMT

> Sure in:
> it goes:
>   use constant MP2 => eval { require mod_perl; $mod_perl::VERSION > 1.99 };
> so MP2 can never be true,

never is an awfully long time :)

> since it should be mod_perl2 not mod_perl. has this

# this stuff is here to assist back compat
# basically, if you
#  PerlModule mod_perl2
# or take similar steps to load mod_perl2 at
# startup you are protected against loading
# (either 1.0 or 1.99) at a later time by accident.
$mod_perl::VERSION = $mod_perl2::VERSION;

> Since I don't have mp1 installed (which I guess happens to work instead)
> the module doesn't work.

I guess the difference is that frank is loading some module somewhere that
loads while you are not.

> FWIW, Apache::DB has 'require mod_perl2';

and there is the difference.

but regardless, stas has a point - we need a definitive way to tell whether
you are running under mp1 or mp2, then update the docs.

my suggestion is to check for $ENV{MOD_PERL_API_VERSION}, which only exists
in the official 2.0 API (mp 1.999_22 and later).  if that isn't set at the
earliest possible moment, before _any_ mod_perl hooks can be called, then we
need to fix that.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message