The other comments are wrong; the problem is that the assignment to @Horse::ISA occurs after the creation of the $horse1 object and subsequent method calls. Put a BEGIN block around our @ISA=("Animal"); and your code will work.
If Perl 5 had a declarative class syntax where subclassing relationships happened at compilation time, this would not be a problem.
In reply to Re: Inheritance in Perl5
by chromatic
in thread Inheritance in Perl5
by tamaguchi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |