in reply to Maintaining Contained Object Attributes
Sounds a bit like you're trying to break encapsulation - which is probably a bad thing.
Given that all access to the values in $self will be via accessor functions (or, at least, they should be) why not let the accessor functions deal with keeping the two values in step.
--sub some_key_from_tn { my $self = shift; if (@_) { # called to set value $self->{some_key_from_tn} = $_[0]; # call Telephone::Number method to set value $self->{tn}->some_key_from_tn($_[0]); } $self->{some_key_from_tn}; }
"The first rule of Perl club is you don't talk about Perl club."
|
|---|