Click here for Vacation Photos

Map & Grep

There are many opinions if map can be more or less cpu efficient than depending on the task*.  If you can use map to avoid  a temporary array, then it can save you some
time, but if you need the intermediate result, then for is faster. Personally, I prefer map (and its cousin grep) for things that can be done in one line:

like my @myIndex = map { $_ = $$_[0] } @mygatheredArray;



Digg it | Save to del.icio.us | Netscape | Reddit | Stumble It!

- - - - - S P O N S O R I N G     A D V E R T I S M E N T - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Post your thoughts in the Comments ...
Not signed up to share your ideas & thoughts?

It’s free and easy to collaborate!
Click Here to begin

Click Here to earn money for reviewing this post

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Leave a Reply

You must be logged in to post a comment.