in reply to Re: Programming in Perl without semicolon
in thread Programming in Perl without semicolon

You couldn't put next/last/redo in bare blocks either, at least not without adding labels. Bare blocks are loops that execute once.

However, that's not a big issue because those commands are practically always used conditionally. Unlike bare blocks, if blocks aren't loops, so you can use if ($cond) { next } (but not { next if $cond }).

If you do have an unconditional loop control command (e.g. { ...; redo }), label the loop (LOOP: { { ... } redo LOOP }) or use a unconditional if ({ { ... } if (1) { redo } }).