in reply to When is a hashreference a subexpresion?

In
sub a { {x}; }

The "{x}" is ambiguous. Are the curlies defining a hash reference, or are they defining a block. In this case it looks like a block, so that's what perl defines. More explicitly

sub e { {x;} } sub f { {x => 1 } }

Defines subs with a block and a hash ref respectively. Perl does a lot to figure out what you might mean when it's ambiguous, and mostly Perl gets it right. The more you help it, the better chance it has of understanding what you meant.

Update: As usual, grandfather comes up with the best advice (see below); use an explicit "return".