Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

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 daffodils sway...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-05-26 13:05 GMT
Find Nodes?
    Voting Booth?