| ☞ | Program
Repair Shop ![]() |
50 |
In the original code, ->_obs_get_parent_observers lists the class observers
We saw a bit of this already
8 lines of code used for caching
Several special cases
In the revised version of the code, it's ->_class_observers
sub _class_observers {
my $self = shift;
my $class = ref($self) || $self;
my @result = @{$class->direct_observers};
{
no strict 'refs';
for (@{"$class\::ISA"}) {
push @result, $_->_class_observers
if $_->isa(__PACKAGE__);
}
}
return @result;
}
This seems totally straightforward
(To me, anyway)
My only worry is __PACKAGE__
I didn't know what to do about that
Another problem for another day
| ☞ | ![]() |
☞ |