in reply to OOP introspection

LanX has already pointed you to @ISA. Note that if this is about method resolution order, see mro, for example it provides a mro::get_linear_isa($classname) function that may be useful.

Also in the case of composition how can I find out which class depends on which class? Or what kind of objects can be injected in the constructor of an other object?

I'm not sure I understand, could you illustrate these questions with code?

Replies are listed 'Best First'.
Re^2: OOP introspection
by salva (Canon) on Apr 04, 2021 at 18:28 UTC
    Indeed, using mro::get_linear_isa($class) is the right way for obtaining the full class hierarchy!