http://qs1969.pair.com?node_id=256895


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

The prints I had in the example were only that: an example. The real script is accessing the hash based on some user input (with validation, of course), not printing out all the keys just for fun.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re: Re: Re: Floats with trailing zeros as a hash key
by kilinrax (Deacon) on May 09, 2003 at 15:05 UTC

    Then use sprintf? The internal representation of numbers shouldn't really matter - you can always convert them to the right format if needs be.

    If it is important, then initialise them all as strings for consistency, at least.