But the outer for my $i (0..scalar @sig) { ... } in both loop examples still seems to me to have an inherent off-by-one error. This error is masked by the fact that $#sig is used as the range limit in the $i+1..$#sig range expression of both inner loops.
But the inherent error (as I consider it) still remains, and must be fixed up or masked or otherwise dealt with in some way, and poses a potential pitfall for future programmers and maintainers. Why not use the more idiomatic (and IMHO correct) for my $i (0 .. $#sig) { ... } form in both outer loops?
Give a man a fish: <%-{-{-{-<
In reply to Re^2: For loop abortions
by AnomalousMonk
in thread For loop abortions
by Sellerzzz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |