perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: issues with figuring out which mp version is running
Date Mon, 23 Jan 2006 18:51:58 GMT
Geoffrey Young wrote:
> Stas Bekman wrote:
>>Geoffrey Young wrote:
>>>but regardless, stas has a point - we need a definitive way to tell
>>>you are running under mp1 or mp2, then update the docs.
>>>my suggestion is to check for $ENV{MOD_PERL_API_VERSION}, which only
>>>in the official 2.0 API (mp 1.999_22 and later).  if that isn't set at
>>>earliest possible moment, before _any_ mod_perl hooks can be called,
>>>then we
>>>need to fix that.
>>That's the case. It needs to be fixed. And so do the docs.
> hmm...
> I started to work on this but couldn't get it to fail as you describe.
> basically all I did was add code that looked for $ENV{MOD_PERL_API_VERSION}
> during config (<Perl> sections) and the open_logs and post_config phases
> (where you said you were having trouble) and I can see it every time.

> yeah, I can see that it's actually set during post_config, but I'm hesitant
> to shuffle things around if I can't actually reproduce the problem in the
> first place.

You're right, Geoff. They do get populated at the server startup:

static void modperl_boot(pTHX_ void *data)

(it just happens twice for some reason, I've missed that second population 
happening in modperl_env_hash_keys, it probably happens due to un-tie of %ENV)

In which case checking $ENV{MOD_PERL_API_VERSION} should do the trick.

Stas Bekman
MailChannels: Assured Messaging(TM)
The "Practical mod_perl" book

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

View raw message