http://www.perlmonks.org?node_id=1009061


in reply to failure to compile list eval in block

The usual disambiguators:
{; ... } # Block +{ ... } # Hash constructor

For example,

>perl -ce"{ 1, 2; }" syntax error at -e line 1, near "; }" -e had compilation errors. >perl -ce"{; 1, 2; }" -e syntax OK >perl -ce"map { f() }, @a" syntax error at -e line 1, near "}," -e had compilation errors. >perl -ce"map +{ f() }, @a" -e syntax OK