in reply to Catching writes to a bless'ed hash

If you don't want other code to alter attributes, then perhaps using a hashref isn't the right way to implement an object.

Inside out objects are designed to prevent this. And with 5.10.x, implementing inside out objects is much easier:

use strict; use warnings; use Hash::Util::FieldHash; fieldhash my %attr1; # You need one for each attribute. sub new {bless \do {my $var}, shift} sub set_attr1 { my $self = shift; $attr1{$self} = shift; } sub get_attr1 { my $self = shift; $attr1{$self} } etc.
Since the attribute is tucked inside a lexical variable, it's impossible for code defined outside of the scope to touch the attribute.

There's also a couple of modules out there to help you implement inside out objects, but I don't think they make use of fieldhashes (meaning they do extra work at DESTROY and CLONE time). Of course, if you're stuck with an old perl, those modules are the way to go.