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

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
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


In reply to Debugger shows label as belonging to the line before by QM

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (15)
    As of 2014-08-01 13:35 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Who would be the most fun to work for?















      Results (20 votes), past polls