The down side is that last becomes equivalent to next (unless you use a label).
$ perl -le'for (1..2) { { print; last; } cleanup; }' 1 2
The up side is that it solves the following problem nicely:
$ perl -Mstrict -e'for (@ARGV) { my $x; } continue { cleanup($x) }' Global symbol "$x" requires explicit package name at -e line 1. -e had compilation errors.
In reply to Re^2: Avoiding goto
by ikegami
in thread Avoiding goto
by elTriberium
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |