TooMuchCode::ProhibitUnusedConstant -- Find unused constants.
This policy finds constant declarations by "constant" pragma, and further looks to see if they exist in the rest of the code. (The scope of searching is within the same file.)
It identifies constants defined in two simple forms, such as:
use constant PI => 3.14;
... and
use constant { PI => 3.14, TAU => 6.28 };
To install Perl::Critic::TooMuchCode, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::TooMuchCode
CPAN shell
perl -MCPAN -e shell install Perl::Critic::TooMuchCode
For more information on module installation, please visit the detailed CPAN module installation guide.