| ☞ | Program
Repair Shop ![]() |
56 |
You'd think this would be simple
Since it's basically $O{$self} = []
Here's the original code:
61 sub delete_all_observers {
62 my ( $item ) = @_;
65 my $num_removed = 0;
66 return $num_removed unless ( ref $O{ $item } eq 'ARRAY' );
67 $num_removed = scalar @{ $O{ $item } };
68 $O{ $item } = [];
69 return $num_removed;
70 }
If this were up to me, I would get rid of the return value
Who cares how many observers there were before we blew them all away?
If you really want to know, call ->get_observers before you kill them.
Oh, well.
| ☞ | ![]() |
☞ |