http://www.perlmonks.org?node_id=603840

rlb3 has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I've been toying around with perl 5.9.4. Just testing out some of the new features. One of those feature I don't understand is UNIVERSAL::DOES(). I've read the perldelta for perl 5.9.4 and the newest edition of The Perl Review which a has an article on perl 5.9.4, but I'm still not getting it. I don't see how it is difference from ISA. Here is some test code I wrote.

#!/opt/bleadperl/bin/bleadperl package Role; package Object; @Object::ISA= ('Role'); sub new { my $class = shift; return bless {}, $class; } package main; my $o = Object->new(); print 'Object DOES Role' if $o->DOES(Role);

I don't see how this is really different than using ->isa(). I understand how roles work in Class::Traits and Moose, but I don't have to use @ISA to setup the relationship. I think i'm missing soming basic or I really don't understand how roles or traits are supposed to work. Can someone point me in the right direction?

Thanks,