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:
In reply to Re: Strange compiler behavior with map?
by BrowserUk
in thread Strange compiler behavior with map?
by dwalin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |