Yeah, my first cut was a bit too simple. It's now:
sub does { my ($proto, @methods) = @_; return if ref $proto && ! blessed $proto; my @does; foreach my $method (@methods) { push @does, $proto->can($method) || (); } @does = () unless @does == @methods; return wantarray ? @does : @does ? \@does : (); }
Thanks!
Cheers,
Ovid
New address of my CGI Course.
In reply to Re^2: Class capabilities
by Ovid
in thread Class capabilities
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |