_spitFIRE wrote:
John ORourke wrote:
use Apache2::ServerUtil;
IMHO, doesn't this itself mean that you have Apache 2.x.x installed?

Ah, you didn't say you were detecting v1 or v2 - I thought you just wanted to know the .x.x bit!

If you're just after a '1' or a '2' try:
   $version = ( $ENV{MOD_PERL_API_VERSION}==2 )?2:1;

Borrowing from the way CGI.pm does it you could do this:

my $version='none';
if($ENV{MOD_PERL_API_VERSION}==2){
   require Apache2::ServerUtil;
   $version=Apache2::ServerUtil::get_server_version();
}else{
   require Apache::Constants;
   $version=Apache::Constants::SERVER_VERSION;
}

(I haven't tested this by the way)

cheers
John

Reply via email to