in reply to Strange compiler behavior with map?

This: { "$_" => 1 }, looks to the compiler sufficiently like an anonymous hash that it (heuristically) decides it must be one, rather than an in-line block. And if it was an anonymous hash, then it would mean you had omitted the comma between it and the next argument. Hence the error.

There are various other strategies you can use to cause the heuristic to decide the other way. A not exhaustive list include:


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.