go ahead... be a heretic | |
PerlMonks |
Re: Perl style question: loops with postconditionby djantzen (Priest) |
on Jun 28, 2002 at 10:12 UTC ( [id://177979]=note: print w/replies, xml ) | Need Help?? |
Depends on the purpose of the code. I think the first is the cleanest way for simple loops of this sort, and I'm reticent to use infinite loops for anything other than long running processes. Setting up a deliberately short-circuited infinite loop for this kind of purpose can work against intelligibility IMO. Labels I use semi-frequently but only in nested loops and switches. Here's some fun code though: Update: slight code change to better reflect the nature of the question.
In Section
Seekers of Perl Wisdom
|
|