Subject: | Suggested policy: forbid test ($#foo > -1) |
Inexperienced perl programmers may use $#array to test whether @array
is empty:
if ($#array > -1) { ... }
This would be more idiomatically written as
if (@array) { ... }
or perhaps if you want to be explicit
if (scalar(@array) > 0)
There should be a policy to pick up comparisons of $#foo against -1 and
suggest a better way to test array emptiness.