Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Debugger shows label as belonging to the line before

by QM (Vicar)
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::(blah.pl:2586): 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::(blah.pl:2588): 2588: while (<INFILE>) 2589: {

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

Comments?

-QM
--
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?
Username:
Password:

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
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2014-09-20 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (158 votes), past polls