Perl Module Data::Dumper
Published on 30 Nov 2007Tags #Perl
This modules visualizes data structures:
use Data::Dumper;
# indent level (0 = off, 1 = basic, 2 = extended)
$Data::Dumper::Indent = 1;
# string to prepend lines
$Data::Dumper::Pad = '#';
# name of variable (displayed if Terse=0)
$Data::Dumper::Varname = 'data';
# whether to omit the name of the variable
$Data::Dumper::Terse = 1;
# whether to display whole data structure
$Data::Dumper::Deepcopy = 1;
# whether to quote hash keys
$Data::Dumper::Quotekeys = 1;
my $data = {};
print Dumper($data);
Feedback is always welcome! If you'd like to get in touch with me concerning the contents of this article, please use Twitter.