Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Running Perl TK Debugger in Web Program

by roho (Bishop)
on Mar 31, 2011 at 01:33 UTC ( [id://896528]=perlquestion: print w/replies, xml ) Need Help??

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

I am debugging a website that I just inherited. I want to turn on the Perl TK Debugger when the Perl code is executed from the webpage. I have successfully tested adding -d:ptkdb to the header line of a standalone Perl program and the debugger is activated when the program is run. So far so good.

The code I need to debug is in a local module written for the website. The website is running on Apache. Since web programming is not my strong suit, I am not sure how to identify the actual Perl program executed by the web server when the Submit button is clicked (the program "use"ing the module I need to debug). I want to add -d:ptkdb to that program's header line to activate the debugger when it is executed.

I know I can put 'warn' statements in the module to display variables, etc, but I would much prefer to step through the code using the Perl TK Debugger if possible. Are there some web gurus out there who can help me fill in the last piece of this puzzle? Thanks.

"Its not how hard you work, its how much you get done."

Replies are listed 'Best First'.
Re: Running Perl TK Debugger in Web Program
by vkon (Curate) on Mar 31, 2011 at 08:12 UTC
      Thanks for your reply vkon, but as I mentioned I already know about adding -d:ptkdb to the perl header line to activate the Perl TK Debugger. My question is how to determine the name of the Perl program which gets executed when the Submit button is clicked on the web page.

      "Its not how hard you work, its how much you get done."

        given that this WEB server is probably at your control, and you even have trusted X11 connection to it, (i.e. DISPLAY), this means that you have full control on what perl is issued.

        So, it will be this perl that is specified on you # line

        #! /usr/local/bin/perl ....
Re: Running Perl TK Debugger in Web Program
by scorpio17 (Canon) on Mar 31, 2011 at 21:26 UTC

    Use your web browser to "view source" for the page in question. Look for the "form" element. It will have an "action" attribute which points to the URL to submit the form to, when the submit button is clicked. That URL will be pointing to the perl script you want to look at.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found