my %sub_named = ( this => \&this, that => \&that, ); my $ref = 'this'; my $x; if ( exists $sub_named{ $ref } ) { $x = $sub_named{ $ref }->(); } else { # error, no sub named $ref } #### my @sub_list = qw( this that ); my %sub_named = map { $_ => eval "\\&$_" } @sub_list; # etc. #### use English '-no_match_vars'; my $ref = 'this'; my $x = eval "&$ref()"; if ( my $error_message = $EVAL_ERROR ) { if ( $error_message =~ /^Undefined subroutine / ) { # a dispatch table would have caught this } }