koolgirl,
One of the most effective things you can do to quickly identify and resolve issues with your code is by adopting a consistent methodology to writing the code in the first place. For that, I would recommend reading what I wrote at
Re: Refactoring a large script. If you can avoid introducing the bug then you don't have to spend time fixing it.
When you do need to start bug hunting, many people like brian's Guide to Solving Any Perl Problem. I personally have my own approach which I haven't bothered to document. Often times the biggest help is being able to visualize what's going on - How can I visualize my complex data structure?.
Again, I have my own approach but one common technique I employ is generously sprinkled print statements. If you have addressed all the issues raised by strictures and warnings but your code is still not producing the correct output, find out where your assumptions failed using the bi-section method. Pick some point in the middle of the execution of your code to output the values of your data up to that point. It doesn't matter if all the values are right or wrong - you have eliminated half of your code as being the source of the problem. Either pick the middle execution point before or after (depending on the correctness of the data values) and wash/rinse/repeate the process.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.