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 - - - - -