my %dispatch = ( foo => &somefunc, bar => &someotherfunc, baz => sub {...} ); #### my $funcname = ( $someCondition ? 'foo' : 'bar' ); $funcname->($arg1, $arg2);