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

Debugger shows label as belonging to the line before

by QM (Parson)
on Feb 09, 2011 at 19:20 UTC ( #887256=perlquestion: print w/ replies, xml ) Need Help??
QM has asked for the wisdom of the Perl Monks concerning the following question:

Playing with the debugger today, I saw this:
DB<2> c 2586 main::( 2586: my $found_cycles = 0; 2587: SOME_LABEL:

Note the colon after the label's line number. The debugger uses this hint to say this line is breakable. The label belongs to the statement after this:

2586: my $found_cycles = 0; 2587 SOME_LABEL: 2588: while (<INFILE>) 2589 {

In fact, if I just list the lines, the colons are correct. Seems to be when stopping with a continue or break they aren't.

But I'm surprised the label is displayed for the previous statement, and not the next. If I break on the while, I get this:

DB<3> c 2588 main::( 2588: while (<INFILE>) 2589: {

Note that the opening brace is considered part of this statement (ignoring the colon, as this line isn't breakable).


Quantum Mechanics: The dreams stuff is made of

Comment on Debugger shows label as belonging to the line before
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://887256]
Approved by Corion
Front-paged by Old_Gray_Bear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2015-11-27 21:39 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (734 votes), past polls