Here's a funny (but documented) little quirk:

$i = 1; { print "Foo\n"; last if $i++ > 2; } continue { next if $i < 3; last; }

The docs on continue say it best:

"last", "next", or "redo" may appear within a "continue" block. "last" and "redo" will behave as if they had been executed within the main block. So will "next", but since it will execute a "continue" block, it may be more entertaining.

Replies are listed 'Best First'.
Re: next in continue == entertainment
by Biker (Priest) on Apr 23, 2002 at 09:09 UTC

    Interesting stuff, T.

    I wasn't even aware of continue. Thanks to you I got curious and had to read up on the subject so learnt a new fancy WTDI. Keep 'em comming.


    Everything went worng, just as foreseen.