in reply to using the feature 'switch' in loops
In your example, the last breaks out of the inner for ($a), like it's supposed to. If you use given (which is actually the "switch" statement, not for, even though it can be used), the last does exit the outer foreach like you would expect.
given/when was introduced in Perl 5.10 (Dec 2007) and was retroactively marked experimental in Perl 5.16 (May 2012). While I personally liked given/when, I no longer use it because its implementation is now subject to change.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using the feature 'switch' in loops
by martell (Hermit) on Jul 30, 2014 at 16:36 UTC | |
by Anonymous Monk on Jul 30, 2014 at 17:01 UTC | |
by Anonymous Monk on Jul 30, 2014 at 17:21 UTC |