Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

modperl debugger

by rhymejerky (Beadle)
on Aug 22, 2008 at 05:16 UTC ( [id://706059]=perlquestion: print w/replies, xml ) Need Help??

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

I have been looking around for a mod_perl GUI debugger on windows or linux, so I can debug my mod_perl code when running through a browser. I find it very odd that there is really just one product available (komodo ide by activestate) in the market. Is mod_perl debugging just not popular. Are there any good mod_perl debugger/IDE for remote debugging? I have been doing just print/Dumper and I know there gotta be a better way to do this. Thanks in advance

Replies are listed 'Best First'.
Re: modperl debugger
by trwww (Priest) on Aug 22, 2008 at 08:03 UTC

    My take is that there are no other mod_perl debugging interfaces besides Komodo because the wheel doesn't need reinvented.

    Another reason is that we usually write tests, so we spend less time in the debugger and/or run debugging sessions on the test environment instead of in an apache process.

    But you can use ptkdb to debug mod_perl apps if you need something that weighs less than Komodo.

    UPDATE: I just noticed that you "have been doing just print/Dumper", so you might not be aware about how Apache::DB allows you to run the interactive Perl debugger under mod_perl just like regular perl programs.

    trwww

Re: modperl debugger
by perrin (Chancellor) on Aug 22, 2008 at 18:16 UTC
    I think most of us just prefer the command-line debugger, but if you prefer a GUI, there are other Perl IDEs which may have one. You can also use ptkdb, ebug_wx, emacs (which can automatically move a code window in coordination with the debugger), or Gnu DDD.
Re: modperl debugger
by tomfahle (Priest) on Aug 22, 2008 at 18:54 UTC
      Thanks for the info. It doesn't necessary have to be a a GUI. I am just unsure about how to debug when I load up a web page and have some input (ie select some items or click on some links etc). I have use perl -d to debug scripts, but never try it when a web page is involved. So, just curious how other people do it

        You want Apache::DB.

        Put the following in your httpd.conf:

        # conditionally load the perl debugger <IfDefine PERLDB> <Perl> use Apache::DB (); Apache::DB->init; </Perl> <Location /> PerlInitHandler Apache::DB </Location> </IfDefine>

        Then start apache like so:

        /path/to/apache/bin/httpd -X -D PERLDB

        Instead of returning to the terminal like it usually does, the perl debugger will start. Then you can browse around your site. Now you can set breakpoints, step through code, inspect variables, or whatever.

        The only way I've found to stop the debugger is with kill -9 PID, so you'll need another terminal.

        If you are using mp2, there are a couple additional settings you need. See the link above or run perldoc Apache::DB for the details.

        Hope this helps,

        trwww

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-18 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found