map
map {
block
}
list
map
expr
,
list
Evaluates the
block
or
expr
for each
element of
list
(locally setting
splits a list of lines into a list of words. Often, though, there is a
one-to-one mapping between input values and output values:
This statement translates a list of numbers to the corresponding characters.@chars = map chr, @nums; ![]() Copyright © 2001 O'Reilly & Associates. All rights reserved. |
|