perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject issues with figuring out which mp version is running
Date Sat, 21 Jan 2006 00:13:10 GMT
The docs advertise invalid information about figuring out whether we are 
running under mp2 or mp1:

  use mod_perl;
  use constant MP2 => ($mod_perl::VERSION >= 1.99);

that will always fail, since mp2 now lives in mod_perl2.pm.

I didn't check everywhere, but at least these docs need to be corrected:
http://perl.apache.org/docs/2.0/user/porting/compat.html#C__ENV_GATEWAY_INTERFACE__
http://perl.apache.org/docs/2.0/user/porting/porting.html#Making_Code_Conditional_on_Running_mod_perl_Version

I'm trying to make Apache::DProf to work under mp2 and I thought the 
following will work:

	die "mod_perl is required to run this module"
             unless $ENV{MOD_PERL};
         use constant MP2 => $ENV{MOD_PERL} >= 2;

but no such luck, since $ENV{MOD_PERL} is set at the end of post_config, 
and Apache::DProf loads during the config phase.

I think setting of $ENV{MOD_PERL} needs to be moved to happen as soon as 
perl starts and before we try to run any code or load any modules.

Thanks.

-- 
_____________________________________________________________
Stas Bekman mailto:stas@stason.org  http://stason.org/
MailChannels: Assured Messaging(TM) http://mailchannels.com/
The "Practical mod_perl" book       http://modperlbook.org/
http://perl.apache.org/ http://perl.org/ http://logilune.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message