my $class = ref($self); foreach my $parent (@{"${class}::ISA"}) { my $value = $parent->do_something if $parent->can('do_something'); }
This is a class method, not an object method, so it takes a class-name as the first arg. From what I've read about can(), it only handles blessed references.
In reply to UNIVERSAL::can() doesn't do what I need ... by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |