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


LEOCHARRE-Dev documentation  | view source Contained in the LEOCHARRE-Dev distribution.

Index


NAME

Top

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

SYNOPSIS

Top

   use LEOCHARRE::PMSubs 'subs_defined';

   my $codefile = './lib/Module.pm';
   my $subs = subs_defined($codefile);

   map { print STDERR "$codefile : $_\n" } @$subs;   

DESCRIPTION

Top

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

API

Top

subs_defined()

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 []

_subs_defined()

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 [].

_subs_used()

argument is code text for curiosity returns hash ref with subs used and count of times

CAVEAT: needs to be worked out for kinks

subs_used()

argument is abs path to code file returns hash ref with subs used and count of times

CLI

Top

See bin/pmsubs included in this distro.

AUTHOR

Top

Leo Charre leocharre at cpan dot org

SEE ALSO

Top

LEOCHARRE::PMUsed LEOCHARRE::Dev


LEOCHARRE-Dev documentation  | view source Contained in the LEOCHARRE-Dev distribution.