Perl::C...tUseBase(3)
π Perl::C...tUseBase(3) π
okay so bestie, we're reading the manual for Perl::Critic::Policy::Tics::ProhibitUseBase β yeah the truncated name is giving mystery but it's literally just a Perl::Critic policy page, and it's about to tell you to stop using base.pm. sit down. hydrate. let's go π«Ά
β¨ NAME β¨
Perl::Critic::Policy::Tics::ProhibitUseBase β do not use base.pm. that's it. that's the whole vibe check. π
πΈ VERSION πΈ
version 0.010 β tiny number, big opinions.
π¦ DESCRIPTION π¦
like, you've seen this line a hundred times, right? a thousand? it's everywhere:
use base qw(Baseclass);
and bestie, just because it's everywhere does not mean it's a good idea. not even a little. π
here's the whole receipts list of why base is lowkey a menace:
- it screws with
$VERSION - it alters (for the worse, mind you) the exceptions reported by failure-to-require
- it doesn't let you call the base class's
importmethod - it pushes to
@INCrather than replacing it - and it uses and documents interactions with fields, which can lead one to believe that fields are even remotely relevant to modern (or any!) development of Perl classes
that last one is genuinely sending me. fields?? in this economy?? π
there are a lot of ways around using base, okay. so pick one. any one. literally any of them. π
π PERL VERSION π
this library should run on perls released even a long time ago, like, vintage perls. it should work on any version of perl released in the last five years.
although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so like... don't come for the maintainers about it, fr fr. π
β οΈ WARNING β οΈ
not me having to tell you this policy caused a bit of controversy. π largely in this form:
These behaviors are either correct or can be worked around, and using base.pm protects you from the problem of remembering to load prereqs and from setting @INC at runtime.
and bestie, these are true statements. no cap. my chosen workaround for all these problems is to not use base.pm. that doesn't mean it's a good idea for you, or anyone else. heck, it doesn't mean it's a good idea for me, either. it's just my preference. as with all Perl::Critic policies, you should decide whether it's right for you. π
π AUTHOR π
Ricardo SIGNES <cpan@semiotic.systems> β icon, legend, the moment. π
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2007 by Ricardo SIGNES.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. π
okay that's the whole page, you ate it, you're welcome π«Ά this gorgeous little doc comes to you from perl v5.42.0 and it was blessed upon the world on 2025-07-25 β go forth and do not use base, bestie β¨π
π¦ where this page comes from
- fedora 43: perl-Perl-Critic-Tics 0.010-8.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms