Hi,

!please always reply to the mailing list so the thread doesn't get broken!

well mp uses this value internally and many CPAN-Modules do so either. Versions

mp1 = VERSION < 1.99
mp2 = VERSION >= 1.99

The real syntax would be:

----------------->8-----------------
use mod_perl; ## exists in mp1 and mp2

## set the constant to 0 if mp1 and to 1 if mp2
## but also subversions are working like this e.g. >= 1.99_12 which
## means the version the version must be at least 1.99_13
use constant MP2 => ($mod_perl::VERSION >= 1.99);

BEGIN {
if( MP2 ) {
require Apache::Const;
Apache::Const->import(-compile => 'HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK');
} else {
require Apache::Constants;


Apache::Constants->import('HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK');
  }
}

## proceed with your code
----------------->8-----------------

Tom


John Siracusa wrote:
On Mon, 20 Sep 2004 21:19:58 +0200, Tom Schindl <[EMAIL PROTECTED]> wrote:

Are you looking for this:
-------------->8--------------
use constant MP2 => ($mod_perl::VERSION >= 1.99_12);
-------------->8--------------


I don't know.  What is that? :)  Is that the "officially blessed" way
to do this, or just another alternative that happens to work?  Also,
what's the equivalent for MP1? "$mod_perl::VERSION < 1.99_12"?

-John




--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to