As does the semi-colon trick
my %hash = map {; "$_" => 1 } qw(a b c);
Update:
I thought I'd better explain this idiom since Lawliet /msg'ed me about it.
Braces in perl are used for hashrefs and for blocks and sometimes perl has to "guess" at the intended meaning. Sometimes (as in this case), perl gets it wrong. The addition of a semicolon convinces perl it's a block, not a hashref.
At least that's how I understand it :-)
In reply to Re^2: Puzzling syntax error
by FunkyMonk
in thread Puzzling syntax error
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |