| CPAN Ratings (Gamma) Data-Dumper reviews | |
| Home | Search | About | Login |
RSS | Module Info | Add a review of Data-Dumper
0 out of 10 found this review helpful:
This module is very old and its output is ugly ('$VAR1' anyone?).
I switched to Data::Dump and haven't looked back.
Dan Dascalescu - 2009-02-12 00:16:19
Was this review helpful to you?
Yes
No
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-30 18:03:35
Was this review helpful to you?
Yes
No
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-28 15:25:48
Was this review helpful to you?
Yes
No
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-29 13:38:45
Was this review helpful to you?
Yes
No
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-22 23:13:53
Was this review helpful to you?
Yes
No
I used to think Data::Dumper was the bee's knees for data inspection, but I've recently found that YAML is often more readable. Data::Denter is supposed to be useful for data structure debugging as well, but I haven't had a chance to use it.
Oh, and for serialization, Storable is probably a better option.
Still, probably a "must-have" module.
/s
Sean O'Rourke - 2003-08-18 11:19:47
Was this review helpful to you?
Yes
No
Don't start debuging without this module!
Jasper Cramwinckel - 2003-08-18 06:46:23
Was this review helpful to you?
Yes
No
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|