dump C<0> as such, not C<'0'>
Gurusamy Sarathy [Wed, 16 Jun 1999 16:49:55 +0000 (16:49 +0000)]
p4raw-id: //depot/perl@3540

ext/Data/Dumper/Dumper.pm

index b1fd2b7..d653af3 100644 (file)
@@ -389,7 +389,7 @@ sub _dump {
     elsif (!defined($val)) {
       $out .= "undef";
     }
-    elsif ($val =~ /^-?[1-9]\d{0,8}$/) { # safe decimal number
+    elsif ($val =~ /^(?:0|-?[1-9]\d{0,8})$/) { # safe decimal number
       $out .= $val;
     }
     else {                              # string