[Israel.pm] getting class methods

Gaal Yahas gaal at forum2.org
Tue Aug 10 08:01:06 PDT 2004


On Tue, Aug 10, 2004 at 05:27:16PM +0300, Itamar Elem wrote:
> hi
> 
> given instance of class or class name  how can i get all the methods belonging to this instance/class

perl -le 'sub f{}; do { print if defined *{"${class}::$_"}{CODE} } for keys %{$class."::"}'

To get $class, evaluate $class = ref($proto)||$proto .

-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/



More information about the Perl mailing list