in reply to Perl 5.10 given/when tricks and caveats
This does seem like odd behavior. No switch/select I'm familiar with (I admit that's not many) tries to match multiple cases/whens. Obviously in C the limitations of case tests to simple constants would make that behavior silly.
A switch group is generally used as a prettier form of a series of if/elsif/.../else statements. The Perl implementation of continue seems to just change the next elsif to a plain if. And in that case, why not just use a plain if?
I'd like to see an example of how this behavior was expected to be used.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl 5.10 given/when tricks and caveats
by hardburn (Abbot) on Sep 05, 2008 at 05:21 UTC | |
|
Re^2: Perl 5.10 given/when tricks and caveats
by mr_mischief (Monsignor) on Sep 05, 2008 at 04:23 UTC |