How should I compare Perl references?
References, by default, numify to their addresses. Those reference addresses are unique for every reference, so it can often be used in equality checks. However, in the snippet you showed, you’d first have to make sure that both $ref1 and $ref2 are actually references. Otherwise you might get incorrect results due to regular scalars containing … Read more