in reply to order in map

Forcing a list return from the block works:

 my %hash = map { ("stuff_$_" => $_) } qw(asdf qwert zxcv);

Soon to be unemployed!

Replies are listed 'Best First'.
Re^2: order in map
by ysth (Canon) on May 02, 2005 at 20:02 UTC
    The block always returns a list. Parens don't make lists all by themselves; something has to provide a list context.

    Anyway, my favorite:

    my %hash = map {; "stuff_$_" => $_ } qw(asdf qwert zxcv);