in reply to Re^2: Detecting which class a method is defined in
in thread Detecting which class a method is defined in
I guess the role and mixin stuff on CPAN must do something else if it breaks this.#!perl -l $y='main';$A::y='A';$C::y='C'; sub A::foo { $y } sub A::bar { $y } @C::ISA = 'A'; sub C::bar { $y } use B 'svref_2object'; $x = bless {}, 'C'; for (qw(foo bar)) { print "$_ -> ", $x->$_, " from ", svref_2object(UNIVERSAL::can($x, + $_))->GV->STASH->NAME; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Detecting which class a method is defined in
by chromatic (Archbishop) on May 05, 2011 at 22:00 UTC |