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

I'm debugging (someone else's) legacy cgi-bin code. I read gopalr's How to Debug the CGI Codes; it was helpful. Previously, I've debugged CGI just using Perl's native debugger.

% perl -dw my-cgi-project.pl
But early on, this program makes system calls to determine the user's authority to view the page. This works when run via the browser, but loses when the program is run from the command line. (Presumably because the daemon running the program from the web interface has privileges that I don't.)

Is there any clever way that I can run the single-stepper debugger from within a browser?

Replies are listed 'Best First'.
Re: Single step debugging a CGI in a browswer
by zentara (Cardinal) on Aug 03, 2007 at 18:02 UTC
    Try ptkdb. Search google for tutorials on how to use it, especially the X server settings when debugging a cgi program.

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
Re: Single step debugging a CGI in a browswer
by mkirank (Chaplain) on Aug 03, 2007 at 18:42 UTC
Re: Single step debugging a CGI in a browswer
by spatterson (Pilgrim) on Aug 06, 2007 at 08:45 UTC
    CGI::Carp may be useful, this captures die() and warn() messages & displays them in the page (i.e. to your browser).

    just another cpan module author