
LEOCHARRE::PMSubs - find out what subroutines and or methods are defined in perl code

use LEOCHARRE::PMSubs 'subs_defined';
my $codefile = './lib/Module.pm';
my $subs = subs_defined($codefile);
map { print STDERR "$codefile : $_\n" } @$subs;

This works via regexes and is not perfect, but quick. This is useful for devel purposes.

argument is abs path to perl code file returns array ref of subs defined in file optional argument is boolean, if to include only public methods, methods that do not begin with underscore. default is 0, all subs/methods.
if no file argument, throws exception if file does not exist, warns and returns []
argument is code text returns array ref
optional argument is boolean, if to include only public methods, methods that do not begin with underscore.
if no code, warns and returns [].
argument is code text for curiosity returns hash ref with subs used and count of times
CAVEAT: needs to be worked out for kinks
argument is abs path to code file returns hash ref with subs used and count of times

See bin/pmsubs included in this distro.

Leo Charre leocharre at cpan dot org
