Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

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


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

I think you can't do it because of stubs

sub foo; # stub print("\&foo is ", defined &foo ? 'defined' : 'not defined', "\n"); print(__PACKAGE__->can('foo') ? 'Can' : 'Can\'t', " foo\n"); foo(); __END__ &foo is not defined Can foo Undefined subroutine &main::foo called.

Undefining the CODE slot removes the sub there, but not the stub. Apparently, defined checks for the sub, while can checks for the stub.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found