Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: mod_perl handler detection

by cees (Curate)
on Aug 13, 2005 at 14:14 UTC ( [id://483551]=note: print w/replies, xml ) Need Help??


in reply to mod_perl handler detection

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 }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://483551]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found