Re: [CDBI] Best way to tell if two objects are the same?

[prev] [thread] [next] [Date index for 2006/01/11]

From: Michael Peters
Subject: Re: [CDBI] Best way to tell if two objects are the same?
Date: 14:42 on 11 Jan 2006

Bill Moseley wrote:
> I need to know if $obj1 eq $obj2, and I'm wondering the best way.  I
> suppose ref($obj1) eq ref($obj2) would fail without Live_Object index.

You mean if they are the same object or refer to the same row in the database.
If object, then simply comparing the address given by Scalar::Util::refaddr
would be enough.

If you want to check if they are the same row in the db, then you could compare
their table() and id() to see if they are the same.

Is that what you were asking for?

        -- 
        Michael Peters
Developer
Plus Three, LP


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

Re: [CDBI] Best way to tell if two objects are the same?
Michael Peters 14:42 on 11 Jan 2006

Generated at 09:31 on 23 Jan 2006 by mariachi v0.52