Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How would you use perl debugging tools to pinpoint the problem here?

by BrowserUk (Pope)
on Nov 10, 2005 at 15:35 UTC ( #507406=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://507406]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2014-10-23 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (127 votes), past polls