I use my debugging module (http://cpan.perl.org/authors/id/T/TB/TBOLIOLI/Log-AndError-0.99.tar.gz) which prints to stderr (hence I got bit by the mod_cgi issues with read/write deadlocks on pipes) while tailing the logs, etc. I am looking to include a syslog and other output drivers to my mod which should allow for more fancy versions of the tail -f method.
The key to the print "xxx" if $debug method is to use stderr, categorize diag msgs, have multiple levels and lastly to have many lines of code marked to send diag info to the debugger. By using the module I have eliminated the if statements and simply pass diag info to the debugger which in turn determines if the msg is of importance given current debugging levels. This is more of a performance drag but it cleans up the code plenty.
Tom


Jim Martinez wrote:

The start of a new year has me thinking of how I can improve things. Like the way I develop, debug and test code.

Do you develop with an xterm tailing the logs, an emacs window (or other
editor) to edit the script and/or the packages (and on some occassions
httpd.conf), and a web browser (on an alternate virtual desktop)? Do you
pepper code with :

print "option:" . $option{$foo . "<br>" if $debug;

Fairly low tech, huh.

At apachecon, a speaker (who neither bragged nor rambled) mentioned lwp
use instead of (or to complement) the web browser portion.

Will the use of lwp instead of a browser improve my coding ability (either
in terms of speed or just improving my perl coding)? Seems like I'd have
to spend too much time with the lwp script (tell it to first request the
page then choose option A and B then hit the "submit" button ... )

Is there some way to improve this cycle : edit code -> refresh browser ->
possibly look at the error log -> edit code -> ...

Or maybe you use another approach that's better?

Happy new near (9 days late),
Big big Jim



--
-----------------------------------------------------
Terra Novum Research
[EMAIL PROTECTED]
www.terranovum.com
(617) 923-4132

PO Box 362
Watertown, MA 02471-0362

Never meant half the things I said to you,
so you know,
there's a half that might be true.
 - Glenn Philips


Reply via email to