in reply to Clawing my way out of operator overloading hell
These scalars are not primitive strings, so clearly for this statement to be of any use, someone, somewhere in the inheritance hierarchy has overloaded the 'eq' operator.
Regardless of whether or not that is true in your case, it isn't a foregone conclusion in every case. If you know that two scalars contain references, a string comparison will tell you whether or not they refer to the same thing.
$ perl -le 'my $foo = \1; my $bar = $foo; print "same" if $foo eq $bar +' same
-sauoq "My two cents aren't worth a dime.";
|Replies are listed 'Best First'.|
Re: Re: Clawing my way out of operator overloading hell
by halley (Prior) on Aug 01, 2003 at 15:09 UTC
by sauoq (Abbot) on Aug 01, 2003 at 17:28 UTC