Well, that would address /one/ of my concerns, that is it would not just die on an unblessed reference. But it doesnt address the other issues I mentioned.
Why not?
my $regexp = qr/Some Regex/; warn "It's regexpable!" if $regexp->DOES( 'REGEX' ); my $subref = sub { ... }; warn "It's invokable!\n" if $subref->DOES( 'CODE' ); my $overloaded = Way::OverLoaded->new(); warn "It's indexable/keyable/invokable\n" if $overloaded->DOES( 'ARRAY +' ) && $overloaded->DOES( 'HASH' + ) && $overloaded->DOES( 'CODE' + );
Those may not be the best role names, but I hope the idea is clear.
In reply to Re^5: I don't understand UNIVERSAL::DOES()
by chromatic
in thread I don't understand UNIVERSAL::DOES()
by rlb3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |