Your constructor is already subclassable -- that's what your blessing to $class achieves -- so instead of calling Animal->new call Dog->new and Cat->new directly, and don't bother with the type; it'll happen automagically.
(You can tell what kind of Animal you have by calling ref $obj on an instance.)
In reply to Re: OO & multiple inheritance.
by gaal
in thread OO & multiple inheritance.
by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |