prowler has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Continue block entry
by Zaxo (Archbishop) on May 10, 2005 at 05:47 UTC | |
by prowler (Friar) on May 10, 2005 at 05:56 UTC | |
by demerphq (Chancellor) on May 10, 2005 at 06:48 UTC | |
by ikegami (Patriarch) on May 10, 2005 at 16:54 UTC | |
|
Re: Continue block entry
by ikegami (Patriarch) on May 10, 2005 at 05:44 UTC | |
|
Re: Continue block entry
by Gilimanjaro (Hermit) on May 10, 2005 at 09:36 UTC | |
by prowler (Friar) on May 12, 2005 at 00:02 UTC | |
by Gilimanjaro (Hermit) on May 12, 2005 at 15:23 UTC |