Hmm.. You missed my point (or you're repeating what I said). I wasn't comparing for(ARRAY) with for(TEMP_ARRAY), but for(ARRAY) with for(EXPR;EXPR;EXPR).
I do know that for and foreach are synonymous words. I was trying to clarify that in
for (@array) {$_++}$_ is an implicit alias for the current @array element. While in
for (0 .. $#array) {$array[$_]++}$_ an alias for the current index. And that, in terms of what to use for what (as you already clarified) was the difference I meant...
In reply to Re^6: grep, map vs. foreach performance
by Flexx
in thread grep, map vs. foreach performance
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |