I want to check if two references point to the same object. It seems I can simply use
if ($ref1 == $ref2) { # cheap numeric compare of references print \"ref