in reply to Re^2: sprintf is printing unexepected output
in thread sprintf is printing unexepected output

You want to be careful about Data::Dump, its actually one of the worst serilization modules around. Its relatively trivial to construct a structure that will make Data::Dump extremely unhappy.

Stick with Data::Dumper, and if you need something easier to read and more powerful and accurate then switch to Data::Dump::Streamer.

---
$world=~s/war/peace/g

  • Comment on Re^3: sprintf is printing unexepected output

Replies are listed 'Best First'.
Re^4: sprintf is printing unexepected output
by ferreira (Chaplain) on Dec 30, 2006 at 16:29 UTC

    I really didn't know that. In my experiences (which are far from sophisticated), I don't remember a single time I regreted to use Data::Dump. Probably I haven't reached the edges that you mentioned. Given the zero size of the bug queue of the module and the general quality of modules by Gisle Aas, I thought it was quite a robust module. Maybe such examples of intolerance by Data:Dump should be transformed into bugs, so they get a chance of being fixed.

    But it may be possible as well that things changed since the last time you gave a chance to Data::Dump. For instance, in the Changes file, we read:

       Release 1.05
    
       Improved track scalar references; dump() ended up
       recursing forever on some cyclic structures.
    

    On the other hand, the usage we were telling about was as a debugging aid. If it fails, you can backup to Data::Dumper's ugly output without serious consequences.

      Ugly output? What do you mean?
        I was curious enough to try it...
        # perl -MData::Dump=dump -e '$h = {lol=>2}; $h->{lol2} = $h; print dum +p($h), "\n"' do { my $a = { lol => 2, lol2 => 'fix' }; $a->{lol2} = $a; $a; }

        That really is pretty slick looking compared to Data::Dumper. I'm not going to switch or anything, but you can't deny the output looks cooler. Less efficient maybe, but cooler...

        -Paul

        I meant you have those ugly $VARn variables by default and possibly a series of statements as output which may not be used like this:

        $var = [% dumper_output %];