http://qs1969.pair.com?node_id=411217


in reply to Mysterious "syntax error"

Because map can take either a block or an expression, and open curly can start a block or an expression (start of an anonymous hash), there's some "guessing" code to deal with the ambiguity, and sometimes it guesses wrong.

You can disambiguate these with:

map {; ... definitely a block ... } ... map +{ ... definitely an anonhash ... }, ...
This is documented in perldata I believe. Or perlref.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.