perl5ever has asked for the wisdom of the Perl Monks concerning the following question:
Is there a clever way to undef an "active" subroutine? I'd like to do this:
I find it curious that undef-ing is not permitted but that this is allowed:sub foo { undef &foo; ... }
In my case the sub I want to undef is an AUTOLOAD sub, and I'd want to remove it from the symbol table so it can't get called again.sub foo { *{foo} = sub { warn "second foo" }; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: undef-ing an active subroutine
by ikegami (Patriarch) on Feb 01, 2010 at 15:20 UTC | |
|
Re: undef-ing an active subroutine
by moritz (Cardinal) on Feb 01, 2010 at 15:29 UTC | |
|
Re: undef-ing an active subroutine
by kennethk (Abbot) on Feb 01, 2010 at 15:36 UTC | |
|
Re: undef-ing an active subroutine
by aquarium (Curate) on Feb 01, 2010 at 22:47 UTC |