I don't exactly know how should I use Data::Dumper
Best to have a quick look at the Data::Dumper documentation. The Dumper() function is exported by default and gives a pretty crude picture of the data. Give it an array and it will treat each element as a separate variable but give it a reference to the array and you see an anonymous array. Dump() and its faster but not always available sibling Dumpxs() are fiddlier but more useful as they can give a more accurate picture.
Here's a brief example.
johngg@shiraz ~ $ perl -Mstrict -Mwarnings -MData::Dumper -E '
my @atts = qw{ att1 att2 att3 };
say Dumper( @atts );
say Dumper( \ @atts );
say Data::Dumper->Dump( [ \ @atts ], [ qw{ *atts } ] );
say Data::Dumper->Dumpxs( [ \ @atts ], [ qw{ *atts } ] );'
$VAR1 = 'att1';
$VAR2 = 'att2';
$VAR3 = 'att3';
$VAR1 = [
'att1',
'att2',
'att3'
];
@atts = (
'att1',
'att2',
'att3'
);
@atts = (
'att1',
'att2',
'att3'
);
I hope this is helpful.
|