go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I've been a professional Perl hacker for the past five years, and a very amateurish amateur before that. Over the years my skills have improved tremendously (when I started my first fulltime job, I didn't know how to use references, for example.) I have proceeded from simple utility scripts to large OO systems, mod_perl, giant database frontends, daemons, simulators, GUI applications and all manner of miscellany, but I can't recall ever using the Perl debugger. In fact, I know almost nothing about it. It has been my attitude that print is the most useful debugging tool, especially when coupled with Data::Dumper. If something goes wrong, I sprinke some prints here and there and watch the program flow. I spit out variables and instance data to make sure they are what I think they should be. If it's a daemon or background process, I log the debugging messages somewhere where I can look at them later. If it's a web-app, I like to send a <pre> tag with some Dumper output so I can view the data right there in the rendered template.
I think there's perhaps two possible explanations for my not using the debugger.
Naturally the second possibility causes me some concern. I want to continue learning as much as possible, and if I have stagnated I haven't even realized it until I started this meditation. So I'm interested in hearing the experiences of other Monks vis a vis Perl debugging techniques. Are there instances when the Perl debugger is invaluable, and mere printing or logging will not suffice? Are there times when you must step through a program, instead of narrowing down the problem to a few lines of code and spitting out the potentially broken variables? Or have you found that while my methods may work fine, using the debugger is easier or more efficient? Eagerly awaiting your replies, In reply to I never use the debugger. by friedo
|
|