mikezone has asked for the wisdom of the Perl Monks concerning the following question:
Is there a mechanism to disinherit an inherited method? Such that $object->can( $disinherited_method ) can't?
Conditions:
my $example = new B; if( $example->can( "a3" ) { $example->a3(); # @$*&%! Still there. } else { print "Successful disinheritence!\n"; }
I've tried messing with Exporter in a bunch of ways, after reading the Camel 3rd ed. Unfortunately I glossed over the part on p889 until after I made a bunch of failed examples. I've tried undef( &A::a3 ), only to be greeted with an error I've not seen before (something like undefined subroutine a3() called at line...). Please, no recommendations to refactor my classes.
Much thanks in advance,
- m.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl OO Disinheritence
by miyagawa (Chaplain) on Mar 26, 2002 at 08:00 UTC | |
|
Re: Perl OO Disinheritence
by rjray (Chaplain) on Mar 26, 2002 at 08:14 UTC | |
|
Re: Perl OO Disinheritence
by zengargoyle (Deacon) on Mar 26, 2002 at 07:57 UTC | |
|
•Re: Perl OO Disinheritence
by merlyn (Sage) on Mar 26, 2002 at 15:50 UTC | |
|
Re: Perl OO Disinheritence
by Juerd (Abbot) on Mar 26, 2002 at 18:25 UTC |