Perl: the Markov chain saw | |
PerlMonks |
Continue block entryby prowler (Friar) |
on May 10, 2005 at 05:33 UTC ( [id://455440]=perlquestion: print w/replies, xml ) | Need Help?? |
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
Back to
Seekers of Perl Wisdom
|
|