1Package::Constants(3) User Contributed Perl DocumentationPackage::Constants(3)
2
3
4
6 Package::Constants - List all constants declared in a package
7
9 use Package::Constants;
10
11 ### list the names of all constants in a given package;
12 @const = Package::Constants->list( __PACKAGE__ );
13 @const = Package::Constants->list( 'main' );
14
15 ### enable debugging output
16 $Package::Constants::DEBUG = 1;
17
19 "Package::Constants" lists all the constants defined in a certain
20 package. This can be useful for, among others, setting up an
21 autogenerated "@EXPORT/@EXPORT_OK" for a Constants.pm file.
22
24 @const = Package::Constants->list( PACKAGE_NAME );
25 Lists the names of all the constants defined in the provided package.
26
28 $Package::Constants::DEBUG
29 When set to true, prints out debug information to STDERR about the
30 package it is inspecting. Helps to identify issues when the results are
31 not as you expect.
32
33 Defaults to false.
34
36 Module::Functions - get a list of all the public functions defined in a
37 package.
38
40 Please report bugs or other issues to
41 <bug-package-constants@rt.cpan.org<gt>.
42
44 This module by Jos Boumans <kane@cpan.org>.
45
47 This library is free software; you may redistribute and/or modify it
48 under the same terms as Perl itself.
49
50
51
52perl v5.34.0 2022-01-21 Package::Constants(3)