![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re: Perl style question: loops with postconditionby Popcorn Dave (Abbot) |
on Jun 28, 2002 at 20:01 UTC ( [id://178122]=note: print w/replies, xml ) | Need Help?? |
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...
In Section
Seekers of Perl Wisdom
|
|