Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Perl style question: loops with postcondition

by broquaint (Abbot)
on Jun 28, 2002 at 10:05 UTC ( [id://177978]=note: print w/replies, xml ) Need Help??


in reply to Perl style question: loops with postcondition

In general I use the second form which I guess is because of my C influenced learning. But having given it a second of thought I may switch to using a continue block as it's seems the most natural e.g
while(1) { ... } continue { last unless $condition; }
There's also the issue that the first form is guaranteed to iterate through the loop at least once which isn't always ideal.
HTH

_________
broquaint

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2025-05-23 20:22 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.