if ( $thisref eq $thatref ) { # these are two refs address the same object, whatever it is }