in reply to Class::Privacy
package Foo; use Class::Privacy; #... package Cracker; my $f = new Foo; CORE::bless $f, 'Foo'; $f->_violate_privacy; # works
... seems very hard to get round. (Note that this still protects $f from data violation, because the underlying hash/array/whatever is still a tied proxy.)
Unless there is a way to protect the object from reblessing, Class::Privacy can't really provide guaranteed privacy, and should probably be called Class::Encapsulation or something. One strategy might be to ensure that data calls always come via Foo from MethodProxy, but that doesn't protect you for methods like:
sub _explode { die 'I decided to blow up'; }
dave hj~
|
|---|