The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

TooMuchCode::ProhibitUnusedConstant -- Find unused constants.

DESCRIPTION

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 };