From: Rafael Garcia-Suarez Date: Sun, 28 Dec 2008 22:03:27 +0000 (+0100) Subject: Switch.pm doesn't appear to support plain arrays and hashes in case(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cd3d9d47255d3080961ba7b58c9a145c7b45b905;p=p5sagit%2Fp5-mst-13.2.git Switch.pm doesn't appear to support plain arrays and hashes in case(). --- diff --git a/lib/Switch.pm b/lib/Switch.pm index cc2f0db..aa1bade 100644 --- a/lib/Switch.pm +++ b/lib/Switch.pm @@ -524,10 +524,9 @@ released Nov 22, 2006. case 1 { print "number 1" } case "a" { print "string a" } case [1..10,42] { print "number in list" } - case (@array) { print "number in list" } + case (\@array) { print "number in list" } case /\w+/ { print "pattern" } case qr/\w+/ { print "pattern" } - case (%hash) { print "entry in hash" } case (\%hash) { print "entry in hash" } case (\&sub) { print "arg to subroutine" } else { print "previous case not true" }