in reply to Re: OO Identity Crisis
in thread OO Identity Crisis

What do you mean "obviously there's no such thing in Perl."? What about the UNIVERSAL class, which every class implicitly inherits from?

Replies are listed 'Best First'.
Re^3: OO Identity Crisis
by Transient (Hermit) on Jun 20, 2005 at 17:35 UTC
    You forgot the context:
    Java solves this with the Object class, which all objects derive from. It contains the "equals" method which returns the address of the object (IIRC) by default and can be overloaded by the child.


    There's no standard definition for "equals" which is what I was referring to. Yes, you are correct, though, an equals method could be introduced into UNIVERSAL and simply overridden wherever you like, but it's not going to be something you can rely upon unless they're your own objects.