Perl::...onstant(3pm)
π¦ Perl::...onstant(3pm) β bestie edition π¦
okay so you're reading the manual page for Perl::...onstant(3pm), from the User Contributed Perl Documentation collection. it's short, it's sweet, it's giving "one job and it does it". let's get into it π
β¨ NAME β¨
TooMuchCode::ProhibitUnusedConstant β bestie, it finds unused constants. that's it. that's the whole vibe. π
πΈ DESCRIPTION πΈ
so here's the tea β β this policy goes on a lil detective mission and finds your constant declarations made with the constant pragma, and then it goes looking to see if those constants actually show up anywhere else in the rest of the code.
heads up bestie: the scope of searching is within the same file. it does not follow you across files. no cap. π«Ά
it recognizes constants defined in two simple forms, and here they are, literally verbatim, i'm not touching them:
use constant PI => 3.14;
...and then also this iconic little multi-constant moment:
use constant { PI => 3.14, TAU => 6.28 };
that's the whole thing. two forms. it knows them. it finds them. it tells you when nobody's using them. main character energy fr fr. π
perl v5.36.0 Β· 2023-10-05 β and that's the whole page bestie, documented on 2023-10-05 against perl v5.36.0, and the manual name we folded in up top was Perl::...onstant(3pm) π mwah, go write some constants somebody will actually use β¨π·
π¦ where this page comes from
- debian trixie: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu noble: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu resolute: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu stonking: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms