[Lxr-general] supporting mod_perl better
Brought to you by:
ajlittoz
From: Mike F. <vap...@gm...> - 2006-12-23 05:35:47
|
mod_perl does not allow you to use exit() and in fact spits out warnings ... so the trick is to apply a bit of code like: --- lxr/lib/LXR/Common.pm +++ lxr/lib/LXR/Common.pm @@ -49,6 +49,11 @@ require LXR::Index; require LXR::Lang; +use constant IS_MODPERL => $ENV{MOD_PERL}; +use subs qw(exit); +# Select the correct exit function +*exit = IS_MODPERL ? \&Apache::exit : sub { CORE::exit }; + $wwwdebug = 0; $tmpcounter = 23; i snipped this from the upstream mod_perl docs ... it'll redirect all calls to the proper exit function depending on whether you're running from the command line or from mod_perl -mike |