in reply to Risks of equivalence between FOR and FOREACH

Or just RTFM.

The "foreach" keyword is actually a synonym for the "for" keyword, so you can use "foreach" for readability or "for" for brevity. (Or because the Bourne shell is more familiar to you than csh, so writing "for" comes more naturally.) If VAR is omitted, $_ is set to each value.
  • Comment on Re: Risks of equivalence between FOR and FOREACH