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?
Back to Seekers of Perl Wisdom