use Switch::Perlish; switch $your_var, sub { case 'this', \&this_function; case 'that', \&that_function; case 'the', \&the_function; case 'other', \&other_function; default sub { print "Nothing matched '$your_var'\n" }; };