Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Ultimate Debugging:

by Coplan (Pilgrim)
on Mar 09, 2001 at 03:10 UTC ( [id://63167]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

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

I have an idea for a debugging program that might allow me to input a perl script, and it will print out the program substituting the variables with the current (at time of printing) values of each variable. It might also be cool if I set up some sort of trace function where it would actually print out the line of code (line being that seperated by ';') that is currently being utilized...and thus, it might do a couple of lines a couple of times for loops, and it would order sub routines as it needed to. I'm not too worried about writing this script for debugging of other scripts. But I'd like to do this as a subroutine for some of my programs -- so that it will actually do this to itself. My methodology for this is actually reading the perl script and executing the commands after it stores them temporarily into variables. My problem is that I'd be running this on itself, and before I attempt THAT, I think I'd like to make sure that I won't be causing any potential problems. Is there potential problems for a file reading itself to execute itself within itself? I would have a command line sub-command so that I wouldn't end up with a continuous loop.

Is there perhaps a better way to have a script output itself during execution time while also replacing variables with their actual values?

--Coplan

Replies are listed 'Best First'.
Re (tilly) 1: Ultimate Debugging:
by tilly (Archbishop) on Mar 09, 2001 at 03:40 UTC
    To understand recursion you must first understand recursion.

    Out of curiousity, have you played with the Perl debugger? Check out perldebug.

Re: Ultimate Debugging:
by Tyke (Pilgrim) on Mar 09, 2001 at 09:50 UTC
    If you're writing your own perl debugger you might want to look at the perldebguts document (I believe it was published from 5.6.0) which explains the debugger internals.
    -- I knock my pate and fancy wit will come Knock as I please, there's no one at home a pontiff paraphrased

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://63167]
Approved by root
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.