I change little code there to:Objects = $VAR1 = { 'Bah' => [ 'new', 'printBah' ], 'Object' => [ [ 'new', 'toString' ] ] };
And we get:# Keep going up the tree. # Find all the classes this one is a subclass of. # my @super = @{"${class}::ISA"}; for $name (@super) { # Crawl up the tree and keep trying to crawl up. # Then dump the results into the %methods hash # my $pnewsub = find_methods(); my $pmethods = $pnewsub->($name); my @m = values(%$pmethods); foreach my $val (@{$m[0]}) { $methods{$name} ||= [ ]; push @{$methods{$name}}, $val; } }
I dont really like the @{$m[0]} solution... but it works for now... not sure how it will work if more subclassing is done....Objects = $VAR1 = { 'Bah' => [ 'new', 'printBah' ], 'Object' => [ 'new', 'toString' ] };
In reply to Re^2: Getting methods existing in a Perl Object!
by Ace128
in thread Getting methods existing in a Perl Object!
by Ace128
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |