There's more than one way to do things | |
PerlMonks |
Re: When would you choose foreach instead of map?by bl0rf (Pilgrim) |
on May 20, 2004 at 22:33 UTC ( [id://355106]=note: print w/replies, xml ) | Need Help?? |
map is fairly hideous and foreach looks much nicer. foreach also adds to the linguistic feel of Perl ( the smooth flow ) because it is intuitively understandable and shows off the benefits of arrays. Of course map has its own uses but I think that for simple cases foreach clutters the visual space much less...
In Section
Seekers of Perl Wisdom
|
|