in reply to Re^3: Prevent direct acces to object's attributes
in thread Prevent direct acces to object's attributes
You cannot (re)bless a hash that is locked. Which can hinder certain OO programming techniques. Furthermore, locking a hash doesn't prevent accessing the attributes. 'lock_keys' prevents keys to be added 'lock_value' makes values readonly, and 'lock_hash' makes the entire hash readonly. But keys being readonly still makes them readable. And if you have a reference to the hash (which traditional Perl objects give you), nothing stops you from calling any of the unlock function on them.