Acme-constant
view release on metacpan or search on metacpan
lib/Acme/constant.pm view on Meta::CPAN
You can also use directly use C<import> method, in order to
conditionally load constant.
BEGIN {
require Acme::constant;
Acme::constant->import(DEBUG => 1) if $ENV{DEBUG};
}
Howver, usually the good idea to declare constant anyway, as using
undefined constants in strict mode causes Perl errors (and sometimes
could be parsed incorrectly).
use Acme::constant DEBUG => $ENV{DEBUG};
Constants belong to the package they were defined in. When you declare
constant in some module, the constant is subroutine declared in it.
However, it's possible to export constants with module such as
L<Exporter>, just as you would export standard subroutine.
package Some::Package;
( run in 0.967 second using v1.01-cache-2.11-cpan-d80b1682f3f )