Just a general comment on asking questions here. If you know that the standard way of checking for mod_perl is to test for an environment variable ($ENV{MOD_PERL}), and then you specifically state that you do not want to look at environment variables, then at least give a reason why you don't want to use environment variables. This is more a suggestion for future questions, then a critisism.
Otherwise you will just get a bunch of responses that (correctly so) ask you why you don't want to do things the standard way.
This of course assumes that you know about checking for $ENV{MOD_PERL}, but since you specifically mentioned environment variables, I guess that you do.
As for checking the apache request object to see if mod_perl is being used, I guess you could use eval and check for a failure.
my $r = eval { Apache->instance };
if ($@) {
# mod_perl probably not available
}
But checking the environment variable is much much cleaner.
if (!$ENV{MOD_PERL}) {
# mod_perl is not available
}
|