I've never seen DOES
in a Perl program before, and yet there it is in the docs on universal.
I don't understand completely what the difference between DOES
and ISA
is, though. The specification speaks of roles, perhaps accomplished through aggregation, delegation and mocking. The only kind of class relationship that I know about in Perl is inheritance through the @ISA array (or by using parent
or base
), and I think of roles as only being available with Moose and the like. The documentation also says that most of the time DOES
and ISA
will be the same thing.
Can you give an example where DOES
and ISA
return the different values? What is the practical difference between these two methods?
When you use roles. UNIVERSAL::DOES
behaves the same as UNIVERSAL::isa
, but Moose, Mouse, and Moo all provide DOES
methods on their object classes that return true for classes that consume a given role.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With