my %testHash; # initialize hash my $hashRef = \%testHash; # get a reference to that # get a reference to an element 'a' inside the hash (that does not yet exist) my $destref = \${$hashRef->{'a'}}; # <- problematic line # assign a value to the hash element 'a' $destref = "value"; # verify the result print $hashRef->{'a'} . "\n"; # outputs "SCALAR(0xaddress)"