You can do this, which is somewhat better.
for my $x (0..$#arr) { my $line = $arr[$x]; ## stuff goes here; }
It's even optimized to not create the list.
In reply to Re: Foreach Loops
by ikegami
in thread Foreach Loops
by hubb0r
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |