On 27/06/2013 17:03, Shawn H Corey wrote:
On Thu, 27 Jun 2013 07:45:17 -0700
Jim Gibson <jimsgib...@gmail.com> wrote:

Note that the statement modifier syntax allows you to write a
do-while or do-until loop, where at least one pass is made through
the loop before the loop termination test is performed:

do {
   …
} while condition();

The while here is a statement modifier, and the do{} is a single
statement with one or more internal statements grouped as one.

Please don't use a do...while "loop". Technically, it's not a loop and
`last`, `next`, and `redo` won't work as you would expect. They will
either jump back to the last `for` or `while` loop, or exit the
subroutine.

See also 'Statement Modifiers' in perlsyn.

There it is shown how to make next and last work with do{}. I read that as a rather funny way to discourage people from do-ing it.

--
Ruud



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to