in reply to Anonymous Data Structures: How Do They Work?

Here is the simple answer said without most of the technical language that the other answers gave.

Perl's has an internal naming scheme that involves addresses in machine memory. Humans tend to go cross-eyed when they see names like that, so Perl does a lot of work to make things look like they have names that make some sense to the programmer. With anonymous data structures all that happens is that the programmer tells Perl, "I want this somewhere private" and Perl doesn't bother going through the work of giving it a name for the programmer. However Perl still keeps track of it, just like it does everything else.

(And Perl keeps track of what you still know about, and when you drop the last reference through which you could find that data, Perl goes in and does cleanup. This is called garbage collection.)

So it is anonymous to you, but not to Perl.

  • Comment on Re (tilly) 1: Anonymous Data Structures: How Do They Work?