my %table = ( test => \&test, foo => \&foo, ... ); my $var = "test"; $table{ $var }->($parameter);