I am of two minds about this. On the one hand, he's right. I shouldn't return stringified results for objects/references. On the other hand, comparing object id's is almost never what you want anyway when comparing objects because it just isn't that useful.
In the vast majority of cases when you're going to be working with sets of objects, you should subclass and define your own methods to work specifically with those objects. For example, if I have $f1 = Foo->new(1,2) and $f2 = Foo->new(1,2), then for all intents and purposes $f1 and $f2 are identical.
Of course, the real reason I'm arguing is that I'm feeling lazy and I don't want to have to go back and fix my module.
You don't know if they are identical (Score:2)
you cannot say whether or not they are identical, because you do not know what else the constructor might have done. For instance, it might have recorded a timestamp, connected to a different database, or something else that is not necessarily the same from call to call.
However, if you have
then the object are the same because they are pointing at the same data. Indeed, their string values sh
Re:You don't know if they are identical (Score:2)
Actually, another thing you can do is use overload.pm and define your own "==" operator. Consider:
Re:You don't know if they are identical (Score:2)