in reply to Passing a reference to an element in an array of hashes
In your first sub, $_[0] is an alias for $array_of_hashes[0], which gets auto-vivified, and therefore $array_of_hashes[0] too. In your second sub, $ref also gets vivified, but it has no relation to @array_of_hashes, which stays undef.
Update: fixed typo in var name