Well, to quibble slightly, if you're running under mod_perl you're
not running a CGI--you're running either under Apache::Registry
or as a custom handler, I would assume. But anyway...
How do I do debugging in mod_perl? Loads of warn statements,
usually. :)
Seriously: while I do actually like using the perl debugger from
the command line, I've never played around much with using
it from mod_perl. I just rely on writing things to the error log,
then taking a look at it; using a per-request trace variable that
I can write to and view at the end of a request; etc.
And it really depends *what* you're trying to debug. If you're
trying to debug mod_perl itself--if something's going wrong
internally that you can't figure out--try turning on mod_perl
trace. You can enable the trace for various pieces of mod_perl
operation (configuration setup, request handling, etc.), so it
can be useful.
If you're debugging stuff about the environment, the request,
etc. take a look at Apache::DebugInfo. Or you might want to
look at the Debugging mod_perl section of the guide.
But odds are you're debugging something that you wrote. In
such cases, as I said, I just tend to use the old standby: print
and warn statements. :) |