in reply to Risks of equivalence between FOR and FOREACH

Try this on the command line and see what Perl does for yourself. :)

perl -MO=Deparse -e "print for 1..10"

UPDATE: By the way, if you had simply typed FOR and FOREACH into the simple search box (found at the top of each page) you would have stumbled across this node: For and foreach....

I should also add that my personal preference is to only use FOR. I see no reason to type the extra characters, no matter what kind of loop i am using. I do not agree that FOREACH is more readable than FOR. (You could always say EACH to yourself when reading the code. ;))

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)