...
While simple, this rule is not known among many developers and is not obvious to those unware unaware of it. Consequently, do not prefix an integer with leading zeros. If it is to be interpreted as octal, use the oct()
function, which clearly indicates the number to be treated as octal.
...
Tool | Diagnostic |
---|---|
Perl::Critic | ValuesAndExpressions::ProhibitLeadingZeros |
B::Lint | Illegal octal digit.* |
Bibliography
[Conway 2005] | "Leading Zeroes," p. 58 |
[CPAN] | Elliot Shank, Perl-Critic-1.116 ValuesAndExpressions::ProhibitLeadingZeros |
[Conway 2005], pg. 58. "Leading Zeroes"
...