http://www.perlmonks.org?node_id=1024915


in reply to Re: map syntax error -- weird
in thread map syntax error -- weird

Why does this work? (same result as your proposals)

my %opt; my @vals = qw(title artist album); my @opts = map { "$_"."=s" => \$opt{$_} } @vals; print @opts;

UPDATE: Guess: Because there is some statement in there that needs to be executed rather than a static string only?