You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Nick Tonkin <ni...@tonkinresolutions.com> on 2003/04/03 17:30:37 UTC

$mod_perl::VERSION vs. Apache::exists_config_define("MODPERL2")

Any preference between these two methods of finding out what version
of mod_perl we are running under?

And should we document both in the porting tutorial, or is it better
to just pick one?


- nick

-- 

~~~~~~~~~~~~~~~~~~~~
Nick Tonkin   {|8^)>


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


Re: $mod_perl::VERSION vs. Apache::exists_config_define("MODPERL2")

Posted by Stas Bekman <st...@stason.org>.
Nick Tonkin wrote:
> Any preference between these two methods of finding out what version
> of mod_perl we are running under?
> 
> And should we document both in the porting tutorial, or is it better
> to just pick one?

We need both.

$mod_perl::VERSION tells you the exact version. And it can be queried by any 
non-mod_perl app. You can pick a wrong $mod_perl::VERSION if you have both mp 
installed.

Apache::exists_config_define("MODPERL2") is available only after mod_perl.so 
was loaded (a bit after that), and it's always correct. So this is probably a 
preferrable way to figure out the mod_perl generation.

But the real use for this API is in httpd.conf:

<!IfDefine MODPERL2>
    ...
</IfDefine>

What I don't like about it is that it's called MODPERL2 and not MOD_PERL2. At 
some point I'm going to walk through all the defines that we use and change 
them s/MODPERL/MOD_PERL/ as discussed before.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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