Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl style question: loops with postcondition

by Popcorn Dave (Abbot)
on Jun 28, 2002 at 20:01 UTC ( [id://178122]=note: print w/replies, xml ) Need Help??


in reply to Perl style question: loops with postcondition

I'm not so sure if it's which is most popular as much as it depends on what you're trying to do.

As a lot have said, the do-while loop is popular, but it is different in execution from the while loop.

As it was explained to me in a beginning perl class, you need to simply keep in mind that a while checks the condition initially and may not execute. A do-while executes at least once before the condition is checked.

As far as the LOOP: variant (shudder...) that seems to be more of a throwback to the old days of BASIC, but that's just my opinion. : )

Some people fall from grace. I prefer a running start...

  • Comment on Re: Perl style question: loops with postcondition

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2025-05-12 01:59 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.