diff options
Diffstat (limited to 'contrib/perl5/ext/Data/Dumper')
-rw-r--r-- | contrib/perl5/ext/Data/Dumper/Dumper.pm | 11 | ||||
-rw-r--r-- | contrib/perl5/ext/Data/Dumper/Dumper.xs | 8 |
2 files changed, 10 insertions, 9 deletions
diff --git a/contrib/perl5/ext/Data/Dumper/Dumper.pm b/contrib/perl5/ext/Data/Dumper/Dumper.pm index 93b87f9..a8e59ab 100644 --- a/contrib/perl5/ext/Data/Dumper/Dumper.pm +++ b/contrib/perl5/ext/Data/Dumper/Dumper.pm @@ -9,7 +9,7 @@ package Data::Dumper; -$VERSION = '2.101'; +$VERSION = '2.102'; #$| = 1; @@ -291,8 +291,7 @@ sub _dump { $s->{level}++; $ipad = $s->{xpad} x $s->{level}; - - if ($realtype eq 'SCALAR') { + if ($realtype eq 'SCALAR' || $realtype eq 'REF') { if ($realpack) { $out .= 'do{\\(my $o = ' . $s->_dump($$val, "\${$name}") . ')}'; } @@ -685,7 +684,7 @@ the last. Returns the stringified form of the values stored in the object (preserving the order in which they were supplied to C<new>), subject to the -configuration options below. In an array context, it returns a list +configuration options below. In a list context, it returns a list of strings corresponding to the supplied values. The second form, for convenience, simply calls the C<new> method on its @@ -701,7 +700,7 @@ dumping subroutine references. Expects a anonymous hash of name => value pairs. Same rules apply for names as in C<new>. If no argument is supplied, will return the "seen" list of -name => value pairs, in an array context. Otherwise, returns the object +name => value pairs, in a list context. Otherwise, returns the object itself. =item I<$OBJ>->Values(I<[ARRAYREF]>) @@ -732,7 +731,7 @@ itself. Returns the stringified form of the values in the list, subject to the configuration options below. The values will be named C<$VAR>I<n> in the output, where I<n> is a numeric suffix. Will return a list of strings -in an array context. +in a list context. =back diff --git a/contrib/perl5/ext/Data/Dumper/Dumper.xs b/contrib/perl5/ext/Data/Dumper/Dumper.xs index 990ea74..25e72b1 100644 --- a/contrib/perl5/ext/Data/Dumper/Dumper.xs +++ b/contrib/perl5/ext/Data/Dumper/Dumper.xs @@ -584,8 +584,10 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv, if (SvIOK(val)) { STRLEN len; - i = SvIV(val); - (void) sprintf(tmpbuf, "%"IVdf, (IV)i); + if (SvIsUV(val)) + (void) sprintf(tmpbuf, "%"UVuf, SvUV(val)); + else + (void) sprintf(tmpbuf, "%"IVdf, SvIV(val)); len = strlen(tmpbuf); sv_catpvn(retval, tmpbuf, len); } @@ -803,7 +805,7 @@ Data_Dumper_Dumpxs(href, ...) if ((svp = av_fetch(namesav, i, TRUE))) sv_setsv(name, *svp); else - SvOK_off(name); + (void)SvOK_off(name); if (SvOK(name)) { if ((SvPVX(name))[0] == '*') { |