if ($user_input eq "do this") { &sub_a; } elseif ($user_input eq "do that") { &sub_b; } else { &error("","unexpected input","The input you supplied is not supported"); }