in reply to
Re: If you believe in Lists in Scalar Context, Clap your Hands
in thread If you believe in Lists in Scalar Context, Clap your Hands
OK. The implementation detail is obviously interesting, and one would hope that it is strongly related to the concepts it embodies.
Taking a listy kind of Perl function more or less at random:
- map BLOCK LIST
- map EXPR,LIST
Evaluates the BLOCK or EXPR for each element of LIST (locally setting $_ to each element) and returns the list value composed of the results of each such evaluation. In scalar context, returns the total number of elements so generated. Evaluates BLOCK or EXPR in list context, so each element of LIST may produce zero, one, or more elements in the returned value.
I'm curious how this is to be understood if Perl doesn't know from lists.