Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^2: undef/defined &{$name} while "strict refs"

by anazawa (Scribe)
on Aug 21, 2012 at 19:49 UTC ( #988837=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my $bool = defined &{ 'foo::bar' };
  2. or download this
    my $namespace = do { no strict 'refs'; \%{"foo::"} };
    my $bool = exists $namespace->{bar} && defined *{ $namespace->{bar} }{
  3. or download this
    no strict 'refs';
    my $before = exists $foo::{bar}; # false
    my $bool = defined *{ 'foo::bar' }{CODE};
    my $after = exists $foo::{bar}; # true
  4. or download this
    undef &{ 'foo::bar' };
    no strict 'refs';
    *{ 'foo::bar' } = sub {};
  5. or download this
    no strict 'refs';
    no warnings 'redefine';
    *{ 'foo::bar' } = sub {};
  6. or download this
    my $coderef = \&{ 'subroutine_name' }; 
    #undef $$coderef; # typo ?
    undef &{ $coderef }; 

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988837]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2015-11-27 23:42 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (734 votes), past polls