in reply to Re: Re: Floats with trailing zeros as a hash key
in thread Floats with trailing zeros as a hash key

You could try canonicising (sp? Heck, is that even a word?) the prices before storing them, e.g. like so:
my $key = sprintf("%0.4f", $price); $items{$key}=$item;
You basically force the numbers in a certain format (rounded to 4 decimals and zero padded in this case). That way, you are guaranteed that 45.20 and 45.2 will end up as 45.2000 and thus in the same hash entry.

Now remind me again why you want to put the prices in the keys? What happens if you have two items with equal prices?

CU
Robartes-