good chemistry is complicated,
and a little bit messy -LW
Re: RFC: Basic debugging checklist (updated)by toolic (Bishop)
|on Feb 19, 2009 at 18:19 UTC||Need Help??|
What a terrific response! I'm glad I have enough votes today: ++ to all.
Every suggestion and opinion is valuable. When I post this as a Tutorial, I will link back to this Meditation so that all these valid discussions are available. Since I think this checklist will be most effective if I keep it as terse as possible, I have not captured all the reasons for using certain techniques in the updated meditation below. Nor have I included some of the more advanced methods mentioned.
I was most surprised at the amount of discussions surrounding Data::Dumper. I use it all the time because it always Does What I Want, probably because my programs are much simpler than those of more advanced coders. One advantage of Data::Dumper over its CPAN counterparts is that it is a core module, and therefore, no installation is required. Since this checklist will be geared for beginners, I will mention Data::Dumper and acknowledge the more advanced alternatives. And I will stop being so lazy and try some of them myself to see what I'm missing!
Rather than cluttering the Monastery with individual replies to all your replies, I will toss bouquets of "Thank You"'s to all who spent their time to remind me of and teach me new techniques:
Are you new to Perl? Is your program misbehaving? Not sure where or how to begin debugging? Well, here is a concise checklist of tips and techniques to get you started.
This list is meant for debugging some of the most common Perl programming problems; it assumes no prior working experience with the Perl debugger (perldebtut). Think of it as a First Aid kit, rather than a fully-staffed state-of-the-art operating room.
These tips are meant to act as a guide to help you answer the following questions:
Check to see if your code is what you thought it was: B::Deparse
Check the return (error) status of your commands