in reply to Why is a hash the default "object" in oo perl?
I use inside-out objects for my database persistence module, because it also helps with synchronization. Each object corresponds to a row in some table. So instead of using the pointer address as the key to the instance data hash, I use the primary key from the database. This is a big win, because there may be many objects instantiated that correspond to the same row in the database. When one gets updated, it's updated in the central hash and any other objects corresponding to that row can see it. If I had used blessed hashrefs as objects, it would have been a big pain to push these updates out to all the necessary hashrefs.
What your implementation is missing, however, is a DESTROY method. When doing these inside-out objects, your %agedata hash keeps filling up. When an object is destroyed, you never clean up after yourself. For persistent environments like mod_perl, this can lead to quite a memory leak in the instance data hashes. So be sure to add:
.. and clear out all instance data hashes.sub DESTROY { delete $agedata{+shift}; }
blokhead