John D Groenveld wrote:
In message <[EMAIL PROTECTED]>, Geoffrey Young writes:
I've updated all of my mod_perl 2.0 CPAN modules so that they work with the
latest mod_perl 2.0 release (RC5 aka 1.999_22) and Apache-Test 1.22. here
For those of us supporting Apache 1 and 2, is this right?
package My::Apache::Foo;
use constant MP2 => eval { require mod_perl2; 1 } || 0;
BEGIN {
if (MP2) {
require mod_perl2;
require Apache2::Const;
} else {
require mod_perl;
require Apache::Constants;
}
}
John
[EMAIL PROTECTED]
For performance and consistancy, you'd be better off using
use constant MP2 => |$ENV{MOD_PERL_API_VERSION}| == 2 ? 1 : 0;
or just use the ENV directly
HTH
--
END
-----------------------------------------------------------------------------
Philip M. Gollucci
Senior Developer - Liquidity Services Inc.
Phone: 202.568.6268 (Direct)
E-Mail: [EMAIL PROTECTED]
Web: http://www.liquidation.com