use Switch; foreach my $val (@array) { switch ($val) { case "do_walk" { do_walk() } case "do_run" { do_run(); } case "do_skip" { do_skip(); } } }