summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-12-28 23:03:27 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-12-28 23:03:27 +0100
commitcd3d9d47255d3080961ba7b58c9a145c7b45b905 (patch)
tree3070b3315370fd02aac8a0c721a1a1a5f7d290a0
parentb62fb10ea98565ce5572416500e1e3517cb17d33 (diff)
downloadperl-cd3d9d47255d3080961ba7b58c9a145c7b45b905.tar.gz
Switch.pm doesn't appear to support plain arrays and hashes in case().
-rw-r--r--lib/Switch.pm3
1 files changed, 1 insertions, 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" }