Nate's in the mainstream of Good Perl Taste here. while is good for loops and reading from filehandles, while foreach is good for iterating over some sort of list, whether is is the keys of a hash or the elements of an array.
If you're *really* into cool things, don't forget that you can do this. $_ (the current line) is assumed in those contexts. Neat, huh?
In reply to Speed and Readability
by chromatic
in thread while or foreach?
by BBQ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |