10.17 多分岐文を書く
標準モジュールSwitchを使用する。
use Switch; switch ($value) { case 17 {print "number 17} case "snipe" {print "a snipe"} case /[a-f]+/i {print "pattern matched"} case [1..10,42] {print "in the list"} case (@array) { print "in the array"} case (%hash) {print "in the hash"} else {print "no case applies"} }