On Fri, Aug 31, 2012 at 9:48 AM, Johan Vromans <jvromans@squirrel.nl> wrote: > Darin McBride <dmcbride@cpan.org> writes: > > > Disagreed. The shell's case statement ... > > The shell (what 'the' shell??) only works with strings, creating a whole > different (and much simpler) playground for comparison and matching. > Whereas Perl (at least Perl 5) usually forces a context. I keep thinking that's what Perl ought to do here. Rather than have a single C<when> do three different things depending on the "type" of the match value, have three different, context-forcing case introducers. At which point we could relatively easily bundle several. Modulo nomenclature: numwhen ($current) { ... } numwhen (0) { ... } numwhen (1, -1) { ... } default { ... } I guess we can even handle changing arrays, if we want to: strwhen (@pre_defined) { ... } strwhen (@defined) { ... } strwhen (@seen) { ... } default ( ... } They rather need to be parsed as three different structures in either case (or overload::Constant will bite us), so why not make them three different keywords? EirikThread Previous | Thread Next