Too easy to make off-by-one mistakes that way. Use for my $i ( 0 .. $#list ) { ... } instead, unless you have speficic reason to use for(;;). (I have never had such an occasion, but maybe you will.)
Makeshifts last the longest.
In reply to Re^3: Check for next array element.
by Aristotle
in thread Check for next array element.
by rashley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |