Bug#580059: ITP: libswitch-perl -- A switch statement for Perl
On Tue, May 04, 2010 at 08:32:48PM +0200, Tollef Fog Heen wrote:
> Why not just use feature.pm instead?
>
> use feature qw(switch);
> given ($foo) {
> when (1) { say "\$foo == 1" }
> when ([2,3]) { say "\$foo == 2 || \$foo == 3" }
> when (/^a[bc]d$/) { say "\$foo eq 'abd' || \$foo eq 'acd'" }
> when ($_ > 100) { say "\$foo > 100" }
> default { say "None of the above" }
> }
>
> this is part of 5.10.
Please see #580034 for the context of this. It's very likely that this
won't be packaged in the end as it has no users in Debian currently.
Cheers,
Dominic.
--
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)
Reply to: