Personally, I would consider silently modifying data structures to be a bug. I realize there may be reasons for Data::Dumper treating floats as strings, mostly because Perl relies on the math library used by the C compiler used to build Perl's executable, and it may be distracting to see 123.1 show up as 123.09999… in Data::Dumper's output. The most obvious fix is to modify the documentation ("Data::Dumper outputs all floating point values as strings so that 123.1 doesn't appear as 123.0999…"). This has the obvious advantage of avoiding the need to change any code.
In reply to Re^3: Need some wisdom on strings to numbers
by swampyankee
in thread Need some wisdom on strings to numbers
by decebel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |