Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: undefing *foo{CODE} does not fully work

by ikegami (Patriarch)
on Apr 13, 2006 at 05:03 UTC ( [id://543001]=note: print w/replies, xml ) Need Help??


in reply to Re: undefing *foo{CODE} does not fully work
in thread undefing *foo{CODE} does not fully work

While that and works, it also undefines @foo, %foo, etc. It seems to me that the OP is trying to undefined &foo specifically.

Other working solutions with the same caveat:

my $x = \*foo; undef *$x;

and

my $x = 'foo'; { no strict 'refs'; undef *$x; }

and

my $x = do { no strict 'refs'; \*{'foo'} }; undef *$x;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (None)
    As of 2024-04-18 23:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found