1Perl::Critic::Policy::TUiscesr::CPornothriiPbbeiurttlUe:sd:eCBPraeisrteli(c3D:)o:cPuomleinctya:t:iToincs::ProhibitUseBase(3)
2
3
4
6 Perl::Critic::Policy::Tics::ProhibitUseBase - do not use base.pm
7
9 version 0.009
10
12 use base qw(Baseclass);
13
14 You've seen that a hundred times, right? That doesn't mean that it's a
15 good idea. It screws with $VERSION, it alters (for the worse) the
16 exceptions reported by failure-to-require, it doesn't let you call the
17 base class's "import" method, it pushes to @INC rather than replacing
18 it, and it uses and documents interactions with fields, which can lead
19 one to believe that fields are even remotely relevant to modern (or
20 any!) development of Perl classes.
21
22 There are a lot of ways around using "base". Pick one.
23
25 This policy caused a bit of controversy, largely in this form:
26
27 These behaviors are either correct or can be worked around, and using base.pm
28 protects you from the problem of remembering to load prereqs and from
29 setting @INC at runtime.
30
31 These are true statements. My chosen workaround for all these problems
32 is to not use base.pm. That doesn't mean it's a good idea for you, or
33 anyone else. Heck, it doesn't mean it's a good idea for me, either.
34 It's just my preference. As with all Perl::Critic policies, you should
35 decide whether it's right for you.
36
38 Ricardo SIGNES <rjbs@cpan.org>
39
41 This software is copyright (c) 2007 by Ricardo SIGNES.
42
43 This is free software; you can redistribute it and/or modify it under
44 the same terms as the Perl 5 programming language system itself.
45
46
47
48perl v5.28.1 Pe2r0l1:4:-C0r7i-t2i8c::Policy::Tics::ProhibitUseBase(3)