in reply to do-until: Can't "next" outside a loop block.
Hi humble,
if you check do documentation, you will notice this:
"do BLOCK" does *not* count as a loop, so the loop control
statements "next", "last", or "redo" cannot be used to leave or
restart the block.
check this perlsyn for alternative strategies.
Update:
However, If you must use the do as stated in your code with next, then you have to "double" the braces like so:
Please see perlsyn for more.do{{ next .... }} until ...;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: do-until: Can't "next" outside a loop block.
by humble (Acolyte) on Nov 30, 2012 at 04:57 UTC |