|Perl: the Markov chain saw|
Re: Debugging CGI/PERLby osunderdog (Deacon)
|on Mar 21, 2007 at 16:56 UTC||Need Help??|
I've been here, and it's sometimes difficult. However you should try the -debug option available on the CGI pacakges... Of course I'm assuming you're using that.
Use the following use statement to enable debugging:
Then run the cgi through perl using the debugger settings:
Then you will have to pass cgi parameters. As value pairs. The perldoc for CGI goes into this -- search for 'debugging'.
Also, if there's a point in the flow that you come back to for debugging, you could write out the CGI context to a file . Then subsequently read that context back in to bring you back to a point where you want to debug. restore_parameters is documented in the perldoc.
Finally, and this one takes a little work, but you could possibly force the perl/tk debugger to come up. First you would have to start out your cgi with the following shebang:
HOWEVER. For this to work you would have to allow any xwindow display to open on your desktop. And you would have to have the DISPLAY environment variable set for apache or by apache before the CGI is invoked... It's hard to setup, but it would give you the best debug situation you could imagine.
It would also help if you had a few
lines scattered through the code that you want to debug.
Just a few thoughts that might get you where you want to be.
Hazah! I'm Employed!