Perl::Critic::Policy::Tics::ProhibitUseBase - do not use base.pm
version 0.010
use base qw(Baseclass);
You've seen that a hundred times, right? That doesn't mean that it's a good idea. It screws with $VERSION, it alters (for the worse) the exceptions reported by failure-to-require, it doesn't let you call the base class's import method, it pushes to @INC rather 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.
$VERSION
import
@INC
There are a lot of ways around using base. Pick one.
base
This library should run on perls released even a long time ago. 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.
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.
These are true statements. 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.
Ricardo SIGNES <cpan@semiotic.systems>
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.
To install Perl::Critic::Tics, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::Tics
CPAN shell
perl -MCPAN -e shell install Perl::Critic::Tics
For more information on module installation, please visit the detailed CPAN module installation guide.