XP is just a number | |
PerlMonks |
Re^3: Preventing autovivificationby BrowserUk (Patriarch) |
on Feb 16, 2010 at 05:51 UTC ( [id://823410]=note: print w/replies, xml ) | Need Help?? |
In addition to this, you need to isolate the object (inside out) from the implementation (hash). Sorry, but I think you are compounding two different goals and coming up with a lemon. The original goals of IOOs were:
What you are suggesting is that the internal data implementation should be encapsulated (isolated) from the internal code. This was never a (stated) design goal, but can be achieved by the religious use of accessors, internally. In short, there is no way to stop an attribute from being added to a hash data structure. Auto-vivification is just part of the behavior of hashes. Actually, I think Hash::Util was specifically designed to address this. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|