in reply to Re: How to differentiate hash reference and object reference?
in thread How to differentiate hash reference and object reference?

But ->isa return's true if the argument is in the package's @ISA array. ref( $obj ) does something different. I think UNIVERSAL may be more the way to go.

Ordinary morality is for ordinary people. -- Aleister Crowley
  • Comment on Re^2: How to differentiate hash reference and object reference?

Replies are listed 'Best First'.
Re^3: How to differentiate hash reference and object reference?
by chromatic (Archbishop) on Aug 31, 2005 at 17:21 UTC

    No, isa() returns true if whatever method isa() is for the invocant it returns true. If I wrote an object and overrode isa() to return true based on a the phase of the moon, that's what it would do.

    That's probably unwise code to write, but the purpose of having isa() be a method is so that classes can override it when it makes sense to do so.

      Yes, but I was more on to what the OP wanted to achieve with it. Therefore the suggestion of UNIVERSAL::isa.

      Ordinary morality is for ordinary people. -- Aleister Crowley