in reply to Desparate behavior in loop labels
use warnings; use strict; quit: for (1 .. 10) { check_early ($_); } sub check_early { my $value = shift; last quit if $value == 5; print "$value\n"; }
Prints:
1 Exiting subroutine via last at noname1.pl line 11. 2 3 4 Exiting subroutine via last at noname1.pl line 11.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Desparate behavior in loop labels
by b4swine (Pilgrim) on Aug 29, 2007 at 03:07 UTC | |
|
Re^2: Desparate behavior in loop labels
by amarquis (Curate) on Aug 29, 2007 at 12:59 UTC | |
by mr_mischief (Monsignor) on Aug 29, 2007 at 16:03 UTC |