garu/Data-Printer — pull request #48 by bessarabov (2013-05-16 17:33:46+00:00)
Title: More accurate separation numbers from strings

Here is the sample script:

```perl
#!/usr/bin/perl

use DDP;

my $data = {
not_a_number_1 => "0123",
not_a_number_2 => "Inf",
not_a_number_3 => "Infinity",
not_a_number_4 => "NaN",
not_a_number_5 => "0 but true",
not_a_number_6 => "-0123",
not_a_number_7 => "+0123",
not_a_number_10 => "",
not_a_number_11 => "abc",
not_a_number_12 => "+1",
not_a_number_13 => '1_000',

number_1 => 123,
number_2 => 0,
number_3 => 1,
number_4 => -1,
number_7 => 1.23,
number_8 => 1.23e+38,
number_9 => 1.23e-38,
};

p $data;
```

Current version of Data::Printer output is this way:

![before](https://f.cloud.github.com/assets/47263/513930/ce75a2da-be4b-11e2-8415-8e6e838fdf72.png)

After this path the output is bit more accurate:

![after](https://f.cloud.github.com/assets/47263/513936/f26db768-be4b-11e2-8f5d-8b014f492915.png)

Actually this is not perfect solution, but it is better than the current situation so I have decided to propose this patch.

There is still problems with very large numbers and very small ones. That thing are not numbers, but Data::Printer output them as is they are numbers:

```perl
my $data = {
not_a_number_1 => "123"x20,
not_a_number_2 => ("0." . "0"x20 . "1"),
};
```