my %table = ( foo => \&foo, bar => \&bar, ... ); $table{ $subname }->(); # call