On Sun, Nov 24, 2002 at 12:13:55PM -0500, Tanton Gibbs wrote:

> So, the purpose of map is to change every element of an array in the same
> way and create a new array with those changed elements.

Quite.  Whenever you need to create an list by performing an operation
on every element of another list, think C<map>.

But map can also do more.  For each element of your original list you
can create zero, one or more elements in the result.

$ perl -le 'print map { ($_) x $_ } (0 .. 3)'
122333

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to