In perl, braces can either be a code block or an anonymous hash contructor; sometimes perl has to guess which one you meant, and in this case, guesses wrong. To perl, it sees
{ "key" => value } which looks very hashish; adding semicolons, or ()s or anything really, makes it think its a codeblock instead.