in reply to while or foreach?
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Speed and Readability
by Anonymous Monk on Dec 31, 1999 at 02:20 UTC | |
|
RE: Speed and Readability
by BBQ (Curate) on Dec 24, 1999 at 16:51 UTC |