On Tue, Jan 11, 2011 at 4:57 AM, Sean Murphy <mhysnm1...@gmail.com> wrote:
> Hi all.
>
> I have read the explaination of the Map function and it is still a mystry to
> myself on what it is for and when would you use it?
>
> All explainations I have seen in books and blogs don't make it clear.
>

my @new = map {$_} @arr;

is the same as:

foreach (@arr) {
 push $_, @new;
}

in other words, do something to every element of an array.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to