in reply to Autovivify Module?

In your example, the $ref is actually a reference to an empty hash, not a hash itself. It was automatically created in the if statement. Therefore print $ref will print out the hash location $ref points to.