in reply to Perl style question: loops with postcondition
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...
|
---|