P is for Practical | |
PerlMonks |
Re: Perl style question: loops with postconditionby Zaxo (Archbishop) |
on Jun 28, 2002 at 10:20 UTC ( [id://177982]=note: print w/replies, xml ) | Need Help?? |
Choose the form which fits the situation, and makes linguistic sense. It's not a popularity contest. do () while $condition; suggests the condition is temporary and that the bracketed code labors to make it go away. while (1) { {}; last unless $condition} reads as if the loop is the thing, and that failure of $condition is exceptional. LOOP:{ {}; goto LOOP if $condition} shouts "I don't care what anybody thinks, I'm looping!" ;-) There are many WTDI you omitted, and different programmers will say thinngs differently. TIMTOWTDI, but also DSFDF. After Compline,
In Section
Seekers of Perl Wisdom
|
|