Think about Loose Coupling | |
PerlMonks |
Re^6: grep, map vs. foreach performanceby Flexx (Pilgrim) |
on Sep 04, 2002 at 16:46 UTC ( [id://195127]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|