There are two ways to unconfuse perl about whether you mean a block or an anonymous hash, depending on which one it is:
+{ ... } is always considered an anonymous hash. The unary plus is generally used to explicitly signify that what follows is an expression.
{; ... } is always considered a block.
You’ll find that if you write your code as map {; ... } ..., it works.
Makeshifts last the longest.
In reply to Re: syntax error with map in list context
by Aristotle
in thread syntax error with map in list context
by LucaPette
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |