On Mon, 14 Jan 2002, Michael A Nachbaur wrote:
> Correct me if I'm wrong someone, but it seems that this
> would only evaluate if the hashrefs are equal (which
> wouldn't happen unless you did $obj->equals($obj)).
or if you did
$b = $a;
$b->equals($a);
bcm@void:~ > perl -e '$a = {}; $b = $a; print "a: $a\nb: $b\n"'
a: HASH(0x814374c)
b: HASH(0x814374c)
i guess it depends on your definition of object identity:
1) are two data structures with equivalent values defined as
equal?
$a = {foo => 1};
$b = {foo => 1};
2) (i don't know if i'm using the correct vocabulary) are
two variables referring to the same reference defined as
equal?
$a = {};
$b = $a;