Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: "last" not really outside loop blockby mscharrer (Hermit) |
on Jun 22, 2009 at 15:50 UTC ( [id://773668]=note: print w/replies, xml ) | Need Help?? |
The tricky thing here is that do { ... } while (); is not a single syntax like in C. The do {} is one statement (and not a loop, which is a little confusing) and the postfix while just repeats this like any other statement.
Funnily, simple braces { } qualify as a 'loop' which is processed once. It can be aborted using last.
Therefore you could use: which works without an error message. But it isn't very good style. Try to use a normal while loop instead.
Supplement:
In Section
Seekers of Perl Wisdom
|
|