my $bool = defined &{ 'foo::bar' }; #### my $namespace = do { no strict 'refs'; \%{"foo::"} }; my $bool = exists $namespace->{bar} && defined *{ $namespace->{bar} }{CODE}; #### no strict 'refs'; my $before = exists $foo::{bar}; # false my $bool = defined *{ 'foo::bar' }{CODE}; my $after = exists $foo::{bar}; # true #### undef &{ 'foo::bar' }; no strict 'refs'; *{ 'foo::bar' } = sub {}; #### no strict 'refs'; no warnings 'redefine'; *{ 'foo::bar' } = sub {}; #### my $coderef = \&{ 'subroutine_name' }; #undef $$coderef; # typo ? undef &{ $coderef };