Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
While the string eq operator can check for reference equivalence, the numeric == operator is preferred for this sort of check. It seems that not many people note this message in perlref:
By using the == instead of eq, you compare the addresses directly, rather than converting both operands to strings which happen to include identical character sequences. They're functionally equivalent today, but I imagine someone may find some odd exploit involving stringified references. While I don't think Perl5 could possibly fix stringified references without breaking the semantic assumptions made in a metric buttload of scripts, it's good to get out of the habit of measuring proxied symptoms and instead use the proper operator. -- In reply to Re: Re: Clawing my way out of operator overloading hell
by halley
|
|