Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Perl style question: loops with postcondition

by Zaxo (Archbishop)
on Jun 28, 2002 at 10:20 UTC ( [id://177982]=note: print w/replies, xml ) Need Help??


in reply to Perl style question: loops with postcondition

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,
Zaxo

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://177982]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2025-05-12 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.