Subject: | Class::Delegation overwrites super class DESTROY implementations |
PERL version 5.14.2
I have a superclass with a dedicated implementation of the DESTROY() method. A subclass usually inherits this implementation. Then I have started to use Class::Delegation in my subclass to delegate some method calls to a third independent class. The use of Class::Delegation overwrites the DESTROY() method in my subclass with sub {}. I have debugged the code and I think the reason is line
+83 unless (*{"${class}::DESTROY"}{CODE} ||
Instead of looking into the symbol table UNIVERSAL::can() should be used
+83 unless ($class->can('DESTROY') ||