my $arg = shift || 'DEFAULT'; my %lookup = ( one => \&do_stuff, two => \&do_other_stuff, three => \&do_even_more_other_stuff, DEFAULT => \&do_yet_even_more_other_stuff, ); $lookup{$arg}->();