Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Floats with trailing zeros as a hash key

by Abigail-II (Bishop)
on May 09, 2003 at 16:25 UTC ( [id://256925]=note: print w/replies, xml ) Need Help??


in reply to Floats with trailing zeros as a hash key

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://256925]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-24 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found