in reply to Using an undefined value as a hashref

Here is a trick to achieve your desired results at a cost of 5 more bytes ...
(my $hashref={})->{'foo'} = 'bar';
The initial assignment to {} could, of course, be replaced by an existing hash ref.

     "Man cannot live by bread alone...
         He'd better have some goat cheese and wine to go with it!"