Don't ask to ask, just ask | |
PerlMonks |
Data::Dumper turns floating points numbers into stringsby Hue-Bond (Priest) |
on Jun 14, 2011 at 17:07 UTC ( [id://909619]=perlquestion: print w/replies, xml ) | Need Help?? |
Hue-Bond has asked for the wisdom of the Perl Monks concerning the following question: Esteemed monks, After playing with JSON::RPC::Client and obtaining the error "value is type str, expected real" (not sure if the error comes from client validation or from the server but that doesn't matter) I investigated and found that Data::Dumper was turning my floating point parameters into strings. I tried changing a couple of configuration variables listed in the module's documentation and was surprised to find that Useperl solves the problem:
Both Dumper and Data::Dumper->Dump show this effect. When working with integers, we get more consistent results:
Is this difference in behaviour to be expected? --
Back to
Seekers of Perl Wisdom
|
|