Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2017-03-30 04:02 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (353 votes). Check out past polls.