go ahead... be a heretic | |
PerlMonks |
Re: Floats with trailing zeros as a hash keyby Abigail-II (Bishop) |
on May 09, 2003 at 16:25 UTC ( [id://256925]=note: print w/replies, xml ) | Need Help?? |
I don't see what the problem is. You have exactly the same
issue if you do print 45.20. That trailing 0
'disappears' as well. If you do not want this numeric
behaviour, always treat it as a string, and quote it. Or
always use (s)printf when printing your numbers.
Perl will change numbers into strings and strings into numbers if necessary, that is, when values are used. But you can't expect Perl to treat your numeric literals as string literals. Abigail
In Section
Seekers of Perl Wisdom
|
|