if (*package::foo{CODE}) { # Function package::foo exists. } else { # Function package::foo does not exist. } #### my $function = "package::foo"; { no strict qw/refs/; # We're going to use symbolic refs. if (*{$function}{CODE}) { # Function in $fuction exists. } else { # Function in $function does not exist. } }