• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/Module/H03-May-2022-12130

t/H03-May-2022-7149

xt/H03-May-2022-5038

Build.PLH A D19-May-20131.8 KiB6954

ChangesH A D19-May-2013577 2816

LICENSEH A D19-May-201318 KiB380292

MANIFESTH A D19-May-2013191 1515

META.jsonH A D19-May-20131.9 KiB7978

META.ymlH A D19-May-20131 KiB4544

README.mdH A D19-May-20131.9 KiB7242

cpanfileH A D19-May-2013157 97

README.md

1# NAME
2
3Module::Functions - Get function list from package.
4
5# SYNOPSIS
6
7    package My::Class;
8    use parent qw/Exporter/;
9    use Module::Functions;
10    our @EXPORT = get_public_functions();
11
12# DESCRIPTION
13
14Module::Functions is a library to get a public functions list from package.
15It is useful to create a exportable function list.
16
17# METHODS
18
19## my @functions = get\_public\_functions()
20
21## my @functions = get\_public\_functions($package)
22
23Get a public function list from the package.
24
25If you don't pass the `$package` parameter, the function use `caller(0)` as a source package.
26
27This function does not get a function, that imported from other package.
28
29For example:
30
31    package Foo;
32    use File::Spec::Functions qw/catfile/;
33    sub foo { }
34
35In this case, return value of `get_public_functions('Foo')` does not contain 'catfile'. Return value is `('foo')`.
36
37### RULES
38
39This `get_public_functions` removes some function names.
40
41Rules are here:
42
43- BEGIN, UNITCHECK, CHECK, INIT, and END are hidden.
44- 'import' method is hidden
45- function name prefixed by '\_' is hidden.
46
47## my @functions = get\_full\_functions();
48
49## my @functions = get\_full\_functions($package)
50
51This function get ALL functions.
52ALL means functions that were imported from other packages.
53And included specially named functions(BEGIN , UNITCHECK , CHECK , INIT and END).
54Of course, included also private functions( ex. \_foo ).
55
56# AUTHOR
57
58Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>
59
60# SEE ALSO
61
62[Exporter::Auto](http://search.cpan.org/perldoc?Exporter::Auto) have same feature of this module, but it stands on very tricky thing.
63
64[Class::Inspector](http://search.cpan.org/perldoc?Class::Inspector) finds the function list. But it does not check the function defined at here or imported from other package.
65
66# LICENSE
67
68Copyright (C) Tokuhiro Matsuno
69
70This library is free software; you can redistribute it and/or modify
71it under the same terms as Perl itself.
72