Search results for "module:Perl::Critic::Policy::Variables::RequireNegativeIndices"

Perl::Critic::Policy::Variables::RequireNegativeIndices - Negative array index should be used. River stage three • 131 direct dependents • 386 total dependents

Perl treats a negative array subscript as an offset from the end. Given this, the preferred way to get the last element is $x[-1], not $x[$#x] or $x[@x-1], and the preferred way to get the next-to-last is $x[-2], not "$x[$#x-1" or $x[@x-2]. The bigge...

PETDANCE/Perl-Critic-1.142 - 29 Nov 2022 02:20:23 UTC
1 result (0.061 seconds)