From cd3d9d47255d3080961ba7b58c9a145c7b45b905 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Sun, 28 Dec 2008 23:03:27 +0100 Subject: Switch.pm doesn't appear to support plain arrays and hashes in case(). --- lib/Switch.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Switch.pm b/lib/Switch.pm index cc2f0dbb80..aa1bade5bc 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" } -- cgit v1.2.1