in reply to Re: Sub Routine Problem
in thread Sub Routine Problem
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.
Cheers - L~R
|
|---|