Currently, I do a manual find/replace in the editor of big chunks of code, equivalent to this:
s/;\s*$/; $DEBUG and printf STDERR "***LINE*** [%s] %s: %s (%d)\n", ti +me_stamp(), __FILE__, __PACKAGE__, __LINE__;/
This of course makes the code hard to read, and doesn't work everywhere (I think use and package might have problems with this, maybe others.) Colleagues often get distracted with these, instead of seeing the important bits.
Really I'd just like a source filter or module I can invoke on the command line to safely do this between statements, and not muddy up the source code.
Any suggestions?
Update: I use a special script to run the script on a remote cluster of hardware that is not available locally. All files needed are copied over and untarred into an appropriate temp dir, the script run, and all STDOUT and STDERR reported back to the originating terminal.
Interactive debug would be my first choice, but the nature of the system makes it much easier to do s/// and print lines into the output logs.
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Module for Printing Line Numbers in Debug? by QM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |