in reply to Re^2: "advanced" Perl functions and maintainability
in thread "advanced" Perl functions and maintainability
I disagree. For complex expressions, foreach can always be made more readable than map, because foreach lets you explicitly name the variable that stores each element from the list you're iterating over. Again, this is why I prefer it for anything more than single-statement greps or maps. It may take a little more typing, but in the end, it's clearer and more readable, and yeah, I guess a little easier on the novices too...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: "advanced" Perl functions and maintainability
by Anonymous Monk on Dec 13, 2004 at 10:46 UTC | |
by William G. Davis (Friar) on Dec 13, 2004 at 12:58 UTC | |
by Anonymous Monk on Dec 13, 2004 at 13:49 UTC | |
by William G. Davis (Friar) on Dec 13, 2004 at 14:33 UTC | |
by Anonymous Monk on Dec 13, 2004 at 14:42 UTC | |
|