Acme-constant
view release on metacpan or search on metacpan
lib/Acme/constant.pm view on Meta::CPAN
This makes using constants easier, as you don't have to remember what
sigil do constants use.
=head1 NOTES
As the Perl compiler needs to know about which barewords are keywords,
constants have to defined in C<BEGIN> section. Usually, this is not a
problem, as C<use> statement is automatically put in implicit C<BEGIN>
section, but that also means you cannot dynamically create constants.
For example, in the example below, the C<DEBUG> constant is always
created, with value 1, as C<use> is processed when Perl parser sees
it.
if ($ENV{DEBUG}) {
use Acme::constant DEBUG => 1; # WRONG!
}
It's possible to dynamically use this module using L<if> module,
however, this is likely to cause problems when trying to use constant
that doesn't exist.
( run in 0.222 second using v1.01-cache-2.11-cpan-8d75d55dd25 )