in reply to Detecting which class a method is defined in
#!perl -l package A; sub foo { "A::foo" } sub bar { 'A::bar' } package C; @ISA = 'A'; sub bar { 'bar' } package main; use B 'svref_2object'; $x = bless {}, 'C'; for (qw(foo bar)) { print "$_ is from ", svref_2object(UNIVERSAL::can($x, $_))->GV->ST +ASH->NAME; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Detecting which class a method is defined in
by chromatic (Archbishop) on May 05, 2011 at 20:55 UTC | |
by educated_foo (Vicar) on May 05, 2011 at 21:34 UTC | |
by chromatic (Archbishop) on May 05, 2011 at 22:00 UTC |