Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
We don't bite newbies here... much
 
PerlMonks  

Re: Perl style question: loops with postcondition

by broquaint (Abbot)
on Jun 28, 2002 at 06:05 UTC ( [id://177978]=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.


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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.