in reply to OO & multiple inheritance.
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.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re^2: OO & multiple inheritance.
by merlyn (Sage) on Nov 18, 2004 at 14:34 UTC | |
by hardburn (Abbot) on Nov 18, 2004 at 14:54 UTC | |
by gaal (Parson) on Nov 18, 2004 at 16:35 UTC |