In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Ovid) writes: >--- "Martin A. Hansen" <[EMAIL PROTECTED]> wrote: >> i wonder how i can list all the methods availible from a given object? > >The simple answer: You can't. Welcome to Perl. > >The long answer: there are a variety of strategies you can use to try and figure >this out, but >all of them fall short. For example, here's a snippet that prints out defined >subroutines (or >methods) in a given package: > > { > no strict 'refs'; > my $namespace = sprintf "%s::", $CLASS; > foreach (keys %{$namespace}) { > my $test_sub = sprintf "%s%s", $namespace, $_; > print "$test_sub\n" unless defined &$test_sub; > } > } > >The problem here is that it will not print inherited or AUTOLOADed methods. [snip]
So traverse the inheritance hierarchy and do the same thing with each class: http://search.cpan.org/author/SBURKE/Class-ISA-0.32/ISA.pm -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]