On 4/15/10 8:47 AM, Jari Aalto via RT wrote:
Show quoted text> Queue: Perl-Critic
> Ticket<URL:
https://rt.cpan.org/Ticket/Display.html?id=56622>
>
> On Thu Apr 15 08:58:21 2010, clonezone wrote:
>> On 4/15/10 5:43 AM, Jari Aalto via RT wrote:
>>> -1 is not one of the allowed literal values (0, 1, 2). Use the
> Readonly
>>
>> 6 $debug = -1;
>>
>> How is -1 an element of the set (0, 1, 2)?
>
> And why wouldn't a standard -1, 0, -1 be an allowed set. Why is there
> arbitrary "2" in it?
From the documentation:
"By default, this rule is relaxed in that C<2> is permitted to allow
for common things like alternation, the STDERR file handle, etc.."
There is a special exemption for -1 as a subscript, i.e. $x[-1] is not a violation.
If you disagree with the default set of allowed values, specify the ones you prefer:
[ValuesAndExpressions::ProhibitMagicNumbers]
allowed_values = -1 0 1