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 }

qq

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.

    CountZero

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