The question was "What is the difference between
for and
foreach?" not "What is the difference between the
keywords for and
foreach?" - it could also mean "What are the differences between the
for and
foreach loops?" (of which there are several notable differences which perl does not treat the same)
It's an ambiguous question that should be followed by another question to determine whether it is about the keywords or the loops.
This post has too many branches :)
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."