in reply to difference between for and foreach?
Argh! There is no difference between "for" and "foreach." I write a lot of perl, and have never used "foreach". Why? Because "for" is less typing :). It's sheerly a stylistic thing. Here's the proof, direct from the perl source code:
If you grok C, you'll realize that "for" falls through to the next case statement, the "foreach". Hence, no difference, except for the extra typing. Think of all the wear and tear saved on your keyboard over the years. ;)case KEY_for: case KEY_foreach:
|
|---|