[Pdx-pm] Getting a list of methods that a package responds to

Kyle Dawkins kyle at cepaso.com
Mon Aug 22 16:53:59 PDT 2005


Eric et al.

> Is "certain methods" a finite list (as opposed to a regex match)?  If
> so, you could just see if the object/package can() those methods.
>
> ...
> my @can;
> foreach my $method (@certain_methods) {
>     $package->can($method) and push(@can, $method);
> }
> ...


No, I have no list ahead of time, otherwise I would definitely have  
let "can" do all the work for me.

Randall's suggestion to use perl5db.pl's methods_via() method might  
prove fruitful; I'll let everyone know if it is.

Thanks for all your help so far...

Kyle
Central Park Software
kyle at cepaso.com



More information about the Pdx-pm-list mailing list