Skip to content

Commit

Permalink
Merge pull request #88 from bessarabov/fixing__is_number
Browse files Browse the repository at this point in the history
'-' is a string, not a number
  • Loading branch information
garu committed May 7, 2016
2 parents 6735476 + c30d6f0 commit a065ac9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Data/Printer.pm
Expand Up @@ -366,7 +366,7 @@ sub _is_number {
-? # number can start with minus, but can't start with plus
# is scalar starts with plus it is not number
[0-9-]+ # then there should be some numbers
[0-9]+ # then there should be some numbers
( \. [0-9]+ )? # there can be decimal part, which is optional
Expand Down
1 change: 1 addition & 0 deletions t/43-_is_number.t
Expand Up @@ -43,6 +43,7 @@ my @strings = (
'1_000',
'123\n',
"123\n",
'-',
);

foreach my $not_a_number (@strings) {
Expand Down

0 comments on commit a065ac9

Please sign in to comment.