1Perl::Critic::Policy::BUasnegrPse:Cr:olPn:rt:orChiribibutititecNd:u:mPPbeoerlrliecdDyNo:ac:muBemasen(ng3ts)a:t:iPornohibitNumberedNames(3)
2
3
4

NAME

6       Perl::Critic::Policy::Bangs::ProhibitNumberedNames - Prohibit variables
7       and subroutines with names that end in digits.
8

AFFILIATION

10       This Policy is part of the Perl::Critic::Bangs distribution.
11

DESCRIPTION

13       Similar variables should be meaningfully different.  A lazy way to
14       differentiate similar variables is by tacking a number at the end.
15
16           my $total = $price * $quantity;
17           my $total2 = $total + ($total * $taxrate);
18           my $total3 = $total2 + $shipping;
19
20       The difference between $total and $total3 is not described by the silly
21       "3" at the end.  Instead, it should be:
22
23           my $merch_total = $price * $quantity;
24           my $subtotal = $merch_total + ($merch_total * $taxrate);
25           my $grand_total = $subtotal + $shipping;
26
27       Both variable and subroutine names are checked.
28
29       See
30       <http://www.oreillynet.com/onlamp/blog/2004/03/the_worlds_two_worst_variable.html>
31       for more of my ranting on this.
32

CONFIGURATION

34       This policy has two options: "exceptions" and "add_exceptions".
35
36   "exceptions"
37       This policy starts with a list of numbered names that are legitimate to
38       have ending with a number:
39
40           base64 md5 rc4 sha0 sha1 sha256 utf8 x11 win32
41
42       The exceptions for the policy also apply to names based on the
43       exceptions.  If $base64 is acceptable as an exception, so is
44       $calculated_base64.  The exception must be separated from the left part
45       of the name by at least one underscore to be recognized.
46
47       The exceptions are case-insensitive.  $UTF8 and $utf8 are both seen the
48       same as far as being exceptions.
49
50       To replace the list of exceptions, specify a value for the "exceptions"
51       option.
52
53           [Bangs::ProhibitNumberedNames]
54           exceptions = logan7 babylon5
55
56   "add_exceptions"
57       To add exceptions to the list, give a value for "add_exceptions" in
58       your .perlcriticrc file like this:
59
60           [Bangs::ProhibitNumberedNames]
61           add_exceptions = adam12 route66
62

AUTHOR

64       Andy Lester "<andy at petdance.com>"
65
67       Copyright (c) 2006-2013 Andy Lester
68
69       This library is free software; you can redistribute it and/or modify it
70       under the terms of the Artistic License 2.0.
71
72
73
74perl v5.32.0             Perl::Cri2t0i2c0:-:0P7o-l2i8cy::Bangs::ProhibitNumberedNames(3)
Impressum