http://www.perlmonks.org?node_id=474802


in reply to Understanding the map function

It makes perfect sense to me, though I would probably rephrase it thusly:

Evaluates the BLOCK or EXPR for each element of LIST (locally setting $_ to each element) and returns a list of the results .

That help any?

C.

Replies are listed 'Best First'.
Re^2: Understanding the map function
by wfsp (Abbot) on Jul 14, 2005 at 09:55 UTC
    Nitpick.

    ...returns a list value for each element of LIST...

    It took me a while to get my head 'round that. Once you do the docs make more sense.

      That would make it more confusing, to me. It already says 'evaluates something for each element in list', thus 'returns a list of the results' cant mean anything but 'list of evaluated somethings for each element in list' ... or not?

      C.

      That edit makes the definition imprecise. map can return multiple list values for each element of LIST.

      --jwest



      -><- -><- -><- -><- -><-
      All things are Perfect
          To every last Flaw
          And bound in accord
               With Eris's Law
       - HBT; The Book of Advice, 1:7
      
Re^2: Understanding the map function
by (anonymized user) (Curate) on Jul 14, 2005 at 09:25 UTC
    Thanks - I prefer your suggestion, which makes a clear overview from the beginning.

    Hmmm... though I wonder if anything makes sense provided you already know everything it is trying to say.

    One world, one people