Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
While these will "work", they confuse the issue of what you are trying to accomplish. grep is used to select items from a list. map is used to transform one list into another. Both take one list and return another list. In my opinion, using grep or map for tasks outside of that scope is being 'too cute', and will cost time later when maintenance time comes around. It takes more work (albeit not much) to comprehend the intent of these code blocks. Make it easier on your future-self and avoid using map and grep for this purpose. --MidLifeXis In reply to Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?
by MidLifeXis
|
|