use Switch; $i; chomp($var=); switch ($var){ case(1) { test_func()} } print "case: $i\n"; test_func{ print "\nhello"; }