in reply to Re: OO & multiple inheritance.
in thread OO & multiple inheritance.

(You can tell what kind of Animal you have by calling ref $obj on an instance.)
But don't do that, as it will break the "null subclass test". Instead, use "isa" or "can" to test inheritance or capability. The code:
if (ref $this eq "Some::Class::Of::Interest") { ... }
is almost always wrong, and is red-flagged in my code reviews.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^3: OO & multiple inheritance.
by hardburn (Abbot) on Nov 18, 2004 at 14:54 UTC

    Quick thought for Perl6: ref() could return an any() junction created with the @ISA for the class. Then ref() and isa() would be functionally equivilent.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Re^3: OO & multiple inheritance.
by gaal (Parson) on Nov 18, 2004 at 16:35 UTC
    Yes, you are right, of course.