With that said, I think there is something seriously wrong if you want your subclass to confirm that it inherits from the parent class in a method ;)package Animal; use Moose; has [qw/name age/] => ( isa => 'Str', is => 'rw' ); package Horse; use Moose; extends 'Animal'; sub present { my $self = shift; print $self->isa('Animal') ? "I am an animal" : "I am not animal" }
In reply to Re^2: Inheritance in Perl5
by EvanCarroll
in thread Inheritance in Perl5
by tamaguchi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |