in reply to Re: doubts about Data::Dumper output
in thread doubts about Data::Dumper output

dunno if i understand the Anonymous's answer...

Ok, elaboration, Data::Dumper::Dumpxs() does the actual Dumpering ... and it emits a warning and does a bad job of Dumping the code reference.

This is a genuine perlbug you found, you should report it -- as the link I linked earlier shows, bugs in Dumper can happen, if you report it, it will probably be fixed

Streamer does a good job of dumping the code reference

About the order, yeah, hashes are "unordered" what choroba/LanX said :) .... Data::Dumper does have a Sortkeys option .... as there is https://metacpan.org/pod/Data::Dump::Streamer#Controlling-Hash-Traversal-and-Display-Order

Yes, lets burn some wood :) its a renewable resource

Replies are listed 'Best First'.
Re^3: doubts about Data::Dumper output
by choroba (Cardinal) on Oct 07, 2014 at 00:13 UTC
    I'm not sure what bug you're talking about. The fact that Data::Dumper can't dump code references is documented:
    "Data::Dumper" cheats with CODE references. If a code reference is encountered in the structure being processed (and if you haven't set the "Deparse" flag), an anonymous subroutine that contains the string '"DUMMY"' will be inserted in its place, and a warning will be printed if "Purity" is set.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      I'm not sure what bug you're talking about

      The weird  do{my $o} .... I forgot to realize that $Data::Dumper::Deparse wasn't turned on ... yeah

        Not that weird, it returns a lexical scalar variable for the slot.

        But without polluting the namespace with the dummy name $o, cause the scope is limited.

        Cheers Rolf

        (addicted to the Perl Programming Language and ☆☆☆☆ :)

Re^3: doubts about Data::Dumper output
by Discipulus (Canon) on Oct 07, 2014 at 07:15 UTC
    About $Data::Dumper::Sortkeys: this seems to be unrelated in this case: it can force the default Perl ordering about keys or a special ordering providing a subroutine. Nothing to do with the order reference are created.

    thanks
    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.