http://www.perlmonks.org?node_id=507406


in reply to How would you use perl debugging tools to pinpoint the problem here?

First I would comment out half the top-level calls in the main program. In this case, commenting out sub_2(); prevents the "crash".

Having isolated (using a binary chop) which routine is causing the problem, I'd go into it, and assuming the problem didn't leap out at me as here, I'd comment out half of the body of the sub to find which half the problem lay in. That very quickly allows you to zero in on the line that is the problem.

There are other ways, and some of them are definitely more applicable in other languages, but using a binary chop of comments works very well and quickly in Perl (and most dynamic langauges).


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: How would you use perl debugging tools to pinpoint the problem here?
  • Download Code