Module::Functions - Get function list from package.
package My::Class; use parent qw/Exporter/; use Module::Functions; our @EXPORT = get_public_functions();
Module::Functions is a library to get a public functions list from package. It is useful to create a exportable function list.
Get a public function list from the package.
If you don't pass the $package parameter, the function use caller(0) as a source package.
$package
caller(0)
This function does not get a function, that imported from other package.
For example:
package Foo; use File::Spec::Functions qw/catfile/; sub foo { }
In this case, return value of get_public_functions('Foo') does not contain 'catfile'. Return value is ('foo').
get_public_functions('Foo')
('foo')
This get_public_functions removes some function names.
get_public_functions
Rules are here:
This function get ALL functions. ALL means functions that were imported from other packages. And included specially named functions(BEGIN , UNITCHECK , CHECK , INIT and END). Of course, included also private functions( ex. _foo ).
Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>
Exporter::Auto have same feature of this module, but it stands on very tricky thing.
Class::Inspector finds the function list. But it does not check the function defined at here or imported from other package.
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Module::Functions, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Functions
CPAN shell
perl -MCPAN -e shell install Module::Functions
For more information on module installation, please visit the detailed CPAN module installation guide.