Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: No Pause on Elsif in Debugger

by pemungkah (Priest)
on Sep 26, 2006 at 17:56 UTC ( #574995=note: print w/ replies, xml ) Need Help??


in reply to Re^2: No Pause on Elsif in Debugger
in thread No Pause on Elsif in Debugger

Of course, the Right Place to put the breakpoints is on the code *inside* the if/elsif/else - "right" being "you will actually stop somewhere near where you want to be". I've noticed similar annoying behavior with for loops at times. Just set your breakpoints inside and the problem goes away. This is the least intrusive solution; obviously, you can code to the debugger's limitations by doing things like

if ($cond1) { ... } else { if ($cond2) { ... } else { if ($cond3) { .. } } }
and now you can break at every if. (That looks scarily like some of my old PL/1 programs...)


Comment on Re^3: No Pause on Elsif in Debugger
Download Code
Re^4: No Pause on Elsif in Debugger
by QM (Vicar) on Sep 29, 2006 at 20:35 UTC
    I started to say
    If I have a long if/elsif/elsif/... chain, then setting breakpoints inside every block is painful (especially when repeating the same breakpoints while doing the debug/edit loop).
    However, more than 3 is a good indicator I'm doing something wrong, and should rethink my attack.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      Yes indeed. After more than two or three, it's time to consider a hash and coderefs.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-07-14 07:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (256 votes), past polls