On Wed, 27 Dec 2006 12:46:15 +0100
"Georg Grabler" <[EMAIL PROTECTED]> wrote:
> Hello everybody around.
>
> I've a strange problem occuring on my computer.
>
> I've taken the script from the apache mod_perl documentation, pringing
> my environment variables (${ENV}).
> According to this, my MOD_PERL_API_VERSION is 2, what's fine so far.
>
> Anyway, accessing them from ANY module, with the following code:
> MOD_PERL: {
> ( (exists $ENV{MOD_PERL_API_VERSION}) &&
> ($ENV{MOD_PERL_API_VERSION} == 2) ) and do {
First I would double check that you're actually running under
mod_perl by checking $ENV{MOD_PERL}.
As for detecting which version is in use at runtime, this code
snippet is the "generally accepted way":
BEGIN {
use constant MP2 => eval {
exists $ENV{MOD_PERL_API_VERSION} and
$ENV{MOD_PERL_API_VERSION} >= 2
};
}
Then you can just do if tests on the MP2 constant. I think your
problem may be the == 2 part, as you are very likely running
2.0.1, 2.0.2, 2.0.3, etc.
Hope this helps.
---------------------------------
Frank Wiles <[EMAIL PROTECTED]>
http://www.wiles.org
---------------------------------