A (blessed) reference can overload stringification or eq or == or numerification(?) so any of them can fail. I just use == since it is so much simpler than eq when it comes to references (it doesn't involve constructing a multi-part string, just interpretting a pointer as an integer).
overload's StrVal() documentation recommends Scalar::Util's refaddr(), which would then allow you to use == without worrying about overloading.
- tye
In reply to Re: checking reference equality (refaddr)
by tye
in thread checking reference equality
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |