use Switch; switch ($char) { case 1 { print "1"; } case 2 { print "2"; } }