Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: OOP introspection

by haukex (Archbishop)
on Apr 03, 2021 at 08:32 UTC ( [id://11130761]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130761]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-03-28 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found