in reply to Re^2: Inheritance - parent of parent
in thread Inheritance - parent of parent (solved)
No, SUPER is based on __PACKAGE__, not on ref($self). Quote perlobj,
It is important to note that SUPER refers to the superclass(es) of the current package and not to the superclass(es) of the object.
This is easy to demonstrate.
{ package Base; sub m { print("Boo!\n"); } } { package Child; our @ISA = 'Base'; bless({}, 'Anything')->SUPER::m(); # Boo! }
|
|---|