Kind of complicated. Why not return as soon as you fail to find any method?
sub does { my ( $proto, @method ) = @_; return if ref $proto && !blessed $proto; my @does; push @does, $proto->can( $_ ) || return foreach @method; return wantarray ? @does : \@does; }
That said I think diotalevi’s Params::Validate recommendation is spot on.
Makeshifts last the longest.
In reply to Re^3: Class capabilities
by Aristotle
in thread Class capabilities
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |