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

Re: No Pause on Elsif in Debugger

by qq (Hermit)
on Jul 22, 2004 at 22:48 UTC ( [id://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 }

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-18 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found