http://qs321.pair.com?node_id=179106


in reply to query for methods?

The debugger command `m' shows "methods" defined for a package, so you certainly can do it.

How? Look for functions referenced in the %{PACKAGE_NAME::} hash. Here's an example...

#!/usr/local/bin/perl -w # Find all functions in specified package my $pkg = shift; eval "use $pkg; 1" or die "Failed to load $pkg: $@\n"; # print functions while (my ($key, $val) = each %{"${pkg}::"}) { print "$key\n" if defined *{$val}{CODE}; }
Run giving a package name as argument.

Note that we're using some symrefs here (to access the %{"${pkg}::"} hash), so as least that line should be free of strictness.