Hi there

I've currently got a bit of a problem that I'm trying to debug, but the actual problem isn't that important. The relevant section is a foreach block with an associated continue block, and a few different ways in which the current iteration of the loop can be found lacking, and have 'next' called.

Anyway, the question is: is there anyway to tell within a continue block how it was reached (ie whether it was reached through falling off the associated loop block, or via a 'next', and if possible, which line had the offending 'next' on it).

I'm not sure that this would be useful in production code, but for debugging it could be helpful to let me know why the loop isn't achieving anything. Yes, I could go through the loop and have warnings everywhere (and may have to if the information I want is not obtainable), but if I could just have a single line that lets me know where my logic decides to jump out of the loop I'd be able to track down the problem a whole lot quicker

Thanks

Prowler
 - Spelling is a demanding task that requies you full attention.


In reply to Continue block entry by prowler

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.