in reply to How to create an anonymous array for lines in a file and store a reference to that array in the hash
You are absolutely correct that you can very easily create “a whole bunch of separate references to the same thing,” instead of references to different things.
“Holy EQUIVALENCE, Captain Fortran!”
I confess that I sometimes use the Storable module (or nowadays, Clone to explicitly create a “carbon copy” of whatever I need to be damm sure is a unique copy of a thing. So, I might say... push @myarray, dclone($foobar). It might not be “efficient,” but generally that is not so important to me as “obvious reliability.”
P.S.: As you play “data-structure games,” be mindful of the weaken subroutine in Scalar::Util. If you might be constructing circular-references between data structures, be certain that one or more of the references are “weakened” so that all of the self-referential data structures eventually will be garbage-collected.