Data-Dumper reviews

cpanratings
 

RSS | Module Info | Add a review of Data-Dumper

Data-Dumper (2.125) ****

Hey everybody. I wanted to say I use Data::Dumper a lot for dianostic work. Generally, for storage I use Storable as its faster and more compact. I don't know that the second argument {Dump([\@var], ['*var']} is stressed enough in the common literature. Dumper will extrapolate the var name and generally this is enough to get by. Sometimes, I feel thats a bit cumbersome but it usually does the trick.

Ogre Lawless - 2010-01-13T00:49:45 (permalink)

1 out of 1 found this review helpful. Was this review helpful to you?  Yes No

Data-Dumper (2.125) *****

This module works ok for me.

I cannot complain , 5 stars :)

Maybe a little more details:

I use it when debugging, it's easy to visualize data structures with it.
However, when you want to visualize some big structure, for example a HTML::TreeBuilder object it will produce a big tree(which is what I would expect) in which case Data::TreeDumper would probably be more useful as it can display data structures in many ways.

If the depth of the tree that results is too big it will overflow the line width of your console so that's where the visualization problems begin.

A good renderer for this would be the best way to solve the problem.

____ - 2009-10-14T06:19:42 (permalink)

0 out of 1 found this review helpful. Was this review helpful to you?  Yes No

Data-Dumper (2.121) ***

On the plus side, Data::Dumper is in the core, so it's always going to be available. However, I personally think this has lead to overuse when perhaps it isn't as useful as other things.

What do I mean?

1. Data::Dumper should probably not be used for caching or storing Perl variable/object trees on disk for machine-only use. Storable is far far faster, and more compact.

2. Data::Dumper should NEVER be used for anything security-sensitive, or when moving data across trust boundaries. Because it is code, it's trivial to inject denial-of-service or exploit code into the dump. Non-executing formats like Storable (with CODE execution disabled) or YAML (with CODE execution disabled) should be used instead.

3. Data::Dumper isn't really the easiest thing to read. The profusion of commas, the the fact that a blessed object's class will be at the END of the giant thousand line nesting complicate things a bit. Something like Devel::Dumpvar (which is a standalone implementation of the format used by the Perl debugger) seems to be more readable.

That said, Data::Dumper is still very useful. But I find the number of places that I need it is gradually being stripped away by more useful specific purpose modules.

My other minor nit is that, for a core module, it doesn't seem to work on 5.005 any more. So it's no longer updatable on older codebases stuck on old machines.

Adam Kennedy - 2008-10-30T18:03:35 (permalink)

5 out of 8 found this review helpful. Was this review helpful to you?  Yes No

Data-Dumper (2.121) *****

Data::Dumper is a great debugging tool! I use this module very frequently. It is part of my application template. In my editor I use a key binding with a macro to insert the diagnostic "carp...Dump" statements in the parts of code where I need it. To enable 'ctrl-c g' insert the diagnostic statements, my '~/.emacs' file has:

(global-set-key "\C-cg" 'perl-insert-diagnostics)

(defun perl-insert-diagnostics ()

"Insert 'carp...Data::Dumper'"

(interactive)

(insert "if ( $self->{verbose} > 2 ) {")

(cperl-indent-command)

(insert "\n")

(insert "carp( Data::Dumper->Dump( [$self], ['self'] ) );")

(cperl-indent-command)

(insert "\n")

(insert "}")

(cperl-indent-command)

(insert "\n")

(cperl-indent-command)
)

Timur Shtatland - 2008-10-28T15:25:48 (permalink)

4 out of 6 found this review helpful. Was this review helpful to you?  Yes No

Data-Dumper (2.121) *****

Although I am rating Data::Dumper with 5 stars, the truth is that is misses some efficiency for big data structures. Constructing all the string in memory is quite annoying in some cases. In the other hand, Data::Dump::Streamer is slow in any case (for small or big data structures).

Anyway, 'use Data::Dumper;' is just bellow my 'use strict;' line for every program I write.

Alberto Simoes - 2006-10-29T13:38:45 (permalink)

5 out of 5 found this review helpful. Was this review helpful to you?  Yes No

Data-Dumper (2.121) *****

I use it constantly. They should just make "Dumper" a core Perl function, so developers don't have to remove "use Data::Dumper" when they release code. :-)

jacques - 2006-10-22T23:13:53 (permalink)

7 out of 11 found this review helpful. Was this review helpful to you?  Yes No

Data-Dumper (2.101) *****

Don't start debuging without this module!

jasper - 2003-08-18T06:46:23 (permalink)

3 out of 4 found this review helpful. Was this review helpful to you?  Yes No
2 hidden unhelpful reviews