Perl::Critic::Policy::ValuesAndExpressions::ProhibitConstantPragma3pm
Don't "use constant foo => 15".
Affiliation
This Policy is part of the core Perl::Critic distribution.
Overview
Named constants are a good thing. But don't use the "constant" pragma because barewords don't interpolate. Instead use the Readonly module.
use constant FOOBAR => 42; #not okuse Readonly;Readonly my $FOOBAR => 42; #okReadonly::Scalar my $FOOBAR => 42; #ok
Configuration
This Policy is not configurable except for the standard options.
Releases
10 releases since Debian 5.0 (Lenny); the text changed 9 times.