in reply to map hash instead of map array

"I have decided I love map and want to use it for everything."

map() builds and returns a list. (Or, in scalar context, the number of elements in the list constructed.)

Don't use map() unless you intend to make use of the list returned. (Or the scalar containing the number of elements.)

Update: As Juerd points out, map() returns a list or the number of scalars in the list. Not an array as I initially stated.


Everything went worng, just as foreseen.

Replies are listed 'Best First'.
Re: Re: map hash instead of map array
by Juerd (Abbot) on Apr 04, 2002 at 14:03 UTC

    map() builds and returns an array. (Or, in scalar context, the number of elements in the array constructed.)

    s/array/list/g

    Don't use map() unless you intend to make use of the array returned.

    s/array/list/

    U28geW91IGNhbiBhbGwgcm90MTMgY
    W5kIHBhY2soKS4gQnV0IGRvIHlvdS
    ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
    geW91IHNlZSBpdD8gIC0tIEp1ZXJk