my %coderefs = ( foo => \&Module::function_foo, ); my $function = 'foo'; my $coderef = $coderefs{$function}; unless ($coderef){ # do something about the missing function # (for example try to load it from the module # and augment the %coderefs, this would eliminate # the need to manually set up %coderefs in advance) } my $result = $coderef->('some parameters');