Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

RE: debugging

by merlyn (Sage)
on Aug 29, 2000 at 15:13 UTC ( #30102=note: print w/ replies, xml ) Need Help??


in reply to debugging

I don't use the debugger to "debug" my code either: I come from the old school, where you just add print until it works. {grin} And since that's pretty painful, I usually just do incremental development, adding one little piece at a time, and running the code each time, so that I can tell where it broke when I broke something.

I do use the debugger frequently as an interactive Perl:

$ perl -deal
because the ability to type x arbitrary expression is pretty cool for testing out snippets.

-- Randal L. Schwartz, Perl hacker


Comment on RE: debugging
Download Code
RE: RE: debugging
by toadi (Chaplain) on Aug 29, 2000 at 15:19 UTC
    Actually I agree zith Merlyn. I don't have the ability to over see big problems. I just program a little, try it and add some more. I put print a lot... I just wanted to know if this was a good method.

    My opinions may have changed,
    but not the fact that I am right

RE: RE: debugging
by Adam (Vicar) on Aug 29, 2000 at 19:36 UTC
    The line:
    print DEBUGOUT "\$var=$var\n" if DEBUGGING
    Shows up all over my scripts. If I declare DEBUGGING as a constant the branches get compiled out, and I can choose to log the debug data for later or direct it to STDERR or STDOUT. I havn't done it yet, but I've been thinking about using btrott's Filehandle Filter to do even more with the DEBUGOUT filehandle. Oh, and data::dumper.pm is very useful too. Its rare that this technique doesn't provide me enough info and I have to resort to the debugger. But its nice to know that the debugger is there when I need it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://30102]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2015-07-04 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls