Data::Dumper can be used to do a lot of interesting things, but basically, you just need to use Data::Dumper and then print Dumper (anything).
It can be useful to pass a reference to the object you want to see, not just this object. For example, it's useful in case of AoH (array of hashes):
...but it does not improve anything in case of reference to array of references to arrays:use Data::Dumper; my @hashes = ( { one => 1, two => 2, three => 3 }, { one => 11, two => 22, three => 33 }, ); print Dumper @hashes; print "-"x5,"\n"; print Dumper \@hashes; __END__ $VAR1 = { 'three' => 3, 'one' => 1, 'two' => 2 }; $VAR2 = { 'three' => 33, 'one' => 11, 'two' => 22 }; ----- $VAR1 = [ { 'three' => 3, 'one' => 1, 'two' => 2 }, { 'three' => 33, 'one' => 11, 'two' => 22 } ];
my $reference = [ [ 7, 8, 9 ], [ 10, 11, 12 ], ]; print Dumper $reference; print Dumper \$reference; $VAR1 = [ [ 7, 8, 9 ], [ 10, 11, 12 ] ]; $VAR1 = \[ [ 7, 8, 9 ], [ 10, 11, 12 ] ];
In reply to Re^3: Concept map of data types
by aitap
in thread Concept map of data types
by programmer.perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |