Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: No Pause on Elsif in Debugger

by qq (Hermit)
on Jul 22, 2004 at 22:48 UTC ( #376749=note: print w/replies, xml ) Need Help??

in reply to No Pause on Elsif in Debugger

Update: missed the point.

Its just following the control flow. Its not going to evaluate elsifs that it doesn't need to, because a prior condition passed. I think the rands in your statements are obscuring the issue.

if ( 1 ) { # debugger will see this, just like code } elsif ( 1 ) { # won't see this - nothing will } else { # nor this either }


Replies are listed 'Best First'.
Re^2: No Pause on Elsif in Debugger
by matija (Priest) on Jul 23, 2004 at 05:10 UTC
    Um, you're missing something, too. Take the code:
    if ( 0 ) { warn "a"; } elsif (1) { warn "b"; } else { warn "c"; }
    You will see this execution:
    main::(/tmp/foo:12): if ( 0 ) { DB<1> n main::(/tmp/foo:15): warn "b"; DB<1> n b at /tmp/foo line 15.
    So in an elsif chain, you always see just the first condition, not the first matching condition as your post states.

    20040725 Edit by ysth: correct <code> to </code>

Re^2: No Pause on Elsif in Debugger
by CountZero (Bishop) on Jul 23, 2004 at 15:06 UTC
    Attention: Could it not be that the optimizer simply "optimizes away" the code it can never reach? This would not happen with the "rand" statements.

    Anyhow it doen't matter as far as the debugger is concerned: the debugger only stops on "if"-part.


    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://376749]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2018-05-24 23:50 GMT
Find Nodes?
    Voting Booth?