It works if you put the Cow->speak below the class definitions.
The reason is that the assignment to @ISA happens at run time, so Cow only inherits from Animal for code that comes after the package/class definition.
In reply to Re: really simple OO inheritance question
by moritz
in thread really simple OO inheritance question
by tomgracey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |