http://www.perlmonks.org?node_id=603908

mreece has asked for the wisdom of the Perl Monks concerning the following question:

i have found myself in a situation where perl -e 'use MyApp' compiles fine, but
<Perl> use MyApp; </Perl>
dies with errors. It would be nice if I could use the perl debugger during the apache startup, but the docs for Apache::DB are pretty thin.

what strategies might i pursue to figure out why my module fails to load under Apache/1.3.36 (Unix) mod_perl/1.29? i have been skimming http://perl.apache.org/docs/1.0/guide/debug.html but it seems that my options are to use gdb for startup and Apache::DB for debugging requests.

is there any way to use the perl debugger during apache startup?

update: i have of course verified that @INC is the same in both scenarios..

update 2: i managed to track down my problem the hard way (turns out Rose::DB::Object does things a little differently when $ENV{MOD_PERL}), but the general question still stands: is there any way to use the perl debugger during apache startup?

Replies are listed 'Best First'.
Re: Debugging mod_perl startup
by perrin (Chancellor) on Mar 09, 2007 at 04:27 UTC
    Try setting PERL5OPT=-d before starting apache.
Re: Debugging mod_perl startup
by jesuashok (Curate) on Mar 09, 2007 at 01:19 UTC
    I use apache's log file, to find out all the errors happening during apache startup.
      not that it matters, but these errors were printed to screen, not to log. the question was not what are the errors, but what was causing them.