|
|
| P is for Practical | |
| PerlMonks |
Re: Perl style question: loops with postconditionby djantzen (Priest) |
| on Jun 28, 2002 at 06:12 UTC ( [id://177979]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
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
|
|
||||||||||||||||||||||||