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?
In reply to Re^2: map syntax error -- weird
by hdb
in thread map syntax error -- weird
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |