in reply to Re^3: Possible useless use of map
in thread Possible useless use of map
there are actually two lists, both containing a single element: the first list consists of $hash->{foo}, the second of 1.map {$hash->{foo}} 1;
Think of it this way, if map would not provide list context to its inner block, the following wouldn't do what it does now:
%h = map {$_ => 1} qw[foo bar baz];
|
|---|