One type of the all-time hot question being asked here is about hash of hashes, hash of hashes of hases, array of hashes ... Questions come from different aspects of those complex data structures, which create lots of confusion among new comers of the Perl world (when I was new to Perl, I was confused too).
For a Perl programmer with reasonable amount of experience, those questions are usually easy to answer, and the immediate problem always got resolved. However one big problem behind all this, is rarely touched.
99% of the time, the fact that multi-tier collections of collections being exposed to a single module, points to poor modulization of code, or lack of OO design. If the code happens to have a OO face, then it indicates lack of genuine understanding of OO. As a matter of fact, 99% of the time, OO classes should only see one level of collection. The elements of the collection, whatever how complex they are, their internal structure should not be exposed to the class that holds the collection. Rememebr that, this principle is not only for one tier (or the top tier), it applies to all tiers. In OO world, you do not have collections of complex child data strctures, but only have collections of simple objects (whatever how complex they are indeed, that fact is not exposed, and the class that contains them should never care that complexity).
Your data might be really complex, but it is all about perception and focus.
There is absolutely no reason for a person to believe that his/her data is complex enough and cannot be clearly contained in layers. Think about it, if we are dealing with data that connot be contained as single-tier collection of objects, from day to day, then RDBMS has been dead now for a long time already.
Naked complex data structure can easily create maintainance nightmares. If you don't want it, don't creat it for others.
There will be times you make exceptions, but remember that 99% of the time, the door should be closed.
In reply to multi-tier collections & lack of modulization/OO by pg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |