NAME

Devel::hdb::DB::PackageInfo - Get information about packages and subroutines

SYNOPSIS

my $pkg_list = namespaces_in_package('Foo');

my $sub_list = subs_in_pacakge('Foo');

Functions

namespaces_in_package($package_name)

Returns a listref of all the namespace names under the given package. If package Foo::Bar is loaded, then the namespaces under package "main" is "Foo", and the namespaces under "Foo" is "Bar".

subs_in_package($package_name)

Returns a listref of function names under the given package.

sub_info($sub_name)

Given a subroutine name (including package), returns a hashref of information about where the subroutine was declared: file Filename start Line where the subroutine starts end Line where the subroutine ends source Original source file of the subroutine text source_line Line in the original source file

source and source_loc can differ from file and start in the case of subroutines defined inside of a string eval. In this case, "file" will be a string like (eval 23)[/some/file/path/module.pm:123] representing the text that was eval-ed, and "start" will be the line within that text where the subroutine was defined. "source" would be /some/file/path/module.pm showing where in the original source code the text came from, and "source_line" would be 123, the line in the original source file.

SEE ALSO

Devel::hdb

AUTHOR

Anthony Brummett <brummett@cpan.org>

COPYRIGHT

Copyright 2013, Anthony Brummett. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.