in reply to difference between for and foreach?
However, as Larry intended it, there's a "for" statement, with 3 parts, like C's same-named, and a "foreach" statement, like csh's same-named loop. And they do nicely different things, even though they're both basically loops.
So, yes, there's a difference, except when there's not a difference. If you check the Llama, we're very careful to describe the two kinds of loops seperately. They have different uses and syntax.
-- Randal L. Schwartz, Perl hacker
|
|---|