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
Using a string or number as a reference produces a symbolic reference, as explained above. Using a reference as a number produces an integer representing its storage location in memory. The only useful thing to be done with this is to compare two references numerically to see whether they refer to the same location.
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.
[ e d @ h a l l e y . c c ]