in reply to Re: Re: Re: multidimenional hashes
in thread multidimenional hashes

Yes! Thank you. (but, i still don't see what went wrong in my original example, since I "replicated" the string that was being stored in the variable, and yet still the hash value was undefined.)

Replies are listed 'Best First'.
Re:^5: multidimenional hashes
by flounder99 (Friar) on Oct 11, 2002 at 15:41 UTC
    The compiler stores the numbers in your source code as numbers not as formated text. When you do something with it that requires a string it gets "stringified". Here is an example:
    $string = "39.750000"; $number = 39.750000; print "$string $number\n"; __OUTPUT__ 39.750000 39.75
    As you can see when the runtime stringifies $number it is not necessarily going to be in the same format as in the source code. So do your hash keys with either formatted text using sprintf or numbers by adding zero. I would probably use formatted strings, sometimes floating point numbers can be inconsistent due to their internal representation in hardware.

    --

    flounder