Perl::...nclude(3pm)
β¨ NAME β¨
TooMuchCode::ProhibitUnusedInclude β bestie, this is the policy that goes hunting for unused include statements πβ¨
Oh also, hi, you're reading Perl::...nclude(3pm) from the User Contributed Perl Documentation collection, title Perl::...nclude π
π¦ DESCRIPTION π¦
Okay so listen. This critic policy scans for unused include statements, and it figures out what counts as "unused" based on their documentation. That's the whole vibe check π
Like, real example, fr fr: Try::Tiny implicitly introduces a try subroutine that takes a block. So if you've got a lonely little
use Try::Tiny;
just sitting there all by itself with no try { .. } block anywhere in its scope? π«Ά That's it. That's an "Unused Include". Caught in 4K πΈ
Notice: this module uses a hard-coded list of commonly-used CPAN modules along with the symbols exported from them. It's relatively static, yeah, but it still needs to be revised from time to time. Not me being the maintenance reminder π
and that's the whole page, bestie, you ate π
Sign-off cuteness: this one's from perl v5.36.0, dated 2023-10-05 π β go forth and delete your dead use statements, the unused includes never stood a chance ππΈ
π¦ 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