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

>> If the items in the collection are unblessed scalars, you can compare them
>> directly. The more "interesting" case is where the items are blessed scalars
>> (or "objects"). The default comparison is "==".

Class::DBI lets you do a simple "eq" test for sameness of database objects.

It uses overload to return an encoded key value in a string context, so that $a eq $b works anywhere that primary keys have been declared and both are from the same table.

Update: This overloading leads to a trivial Schwartzian Transform: @t = map { [$_, "$_"] } @u, potentially making any sorting or duplicate checking lightening fast!!