Hi, this is just a heads up about a bug report I just filed to p5p and the maintainer of Data::Dumper. If you set $Data::Dumper::Sortkeys=1 and do not set $Data::Dumper::Useperl=1 under 5.6.1 (win32 at least) you will end up with either erroneous data or a segfault. If you set both at the same time this problem doesnt arise.

Note that this bug does not appear to affect 5.8.0 at all.

use Data::Dumper; use strict; use warnings; $|++; printf "D::D version %s\n",Data::Dumper->VERSION; for my $sk (0,1) { print "\$Data::Dumper::Sortkeys=$sk\n"; $Data::Dumper::Sortkeys=$sk; for my $up (1,0) { print "\$Data::Dumper::Useperl=$up\n"; $Data::Dumper::Useperl=$up; my %rev; my %name; print "Dumper:\n",Dumper(\%rev,\%name),"\n"; } } print "Done\n"; __END__ D::D version 2.121 $Data::Dumper::Sortkeys=0 $Data::Dumper::Useperl=1 Dumper: $VAR1 = {}; $VAR2 = {}; $Data::Dumper::Useperl=0 Dumper: $VAR1 = {}; $VAR2 = {}; $Data::Dumper::Sortkeys=1 $Data::Dumper::Useperl=1 Dumper: $VAR1 = {}; $VAR2 = {}; $Data::Dumper::Useperl=0 Use of uninitialized value in print at c:\temp\test_dd.pl line 15. Dumper: $VAR2 = {};

I post this only as a public service, as I know many people here depend on DD in many ways, and this is a serious bug that is not picked up by the test suite.

Cheers,


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi



In reply to Serious Bug in latest Data::Dumper under 5.6.1 by demerphq

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.