in reply to Re^6: scanning hash
in thread scanning hash

I was thinking of something simpler, such as:
$x = 1.23456; $y = 1.234560000000001; print 0+($x == $y); # prints 0 for me print 0+($x eq $y); # prints 1 for me
or
$x = 0; $y = "0";
Are they equal? Yes and no.

Replies are listed 'Best First'.
Re^8: scanning hash
by Aristotle (Chancellor) on Aug 02, 2004 at 20:37 UTC

    That is a very similar class of problem, although not exactly the same.

    I was dealing with the question of whether to compare "by reference" or "by value". A typical situation where this is an issue is comparing objects. What is the criterion then, identity or equality? The answer is much less clear than with the strings I used to demonstrate the point, because objects manifest as references by definition.

    Makeshifts last the longest.