http://www.perlmonks.org?node_id=114317


in reply to Re: obj dump
in thread obj dump

Perl comes standard with Data::Dumper, which is useful for printing out complex data structures (and even for loading them up again if you need to -- it's nice for simple configuration files). I'm afraid that the only person who could give you a definitive answer about what the code you posted does and how it works is the original author (and maybe not even that person, memory being what it is).

Sample usage (very silly) :

#/usr/bin/perl -w use strict; use Data::Dumper; my $obj = { foo=> [0..4], bar=>"wouldn't it be nice?", baz=>[ qw(if we were older) ], bletch=>"Then we wouldn't have to ... ummm, something +something"}; print Data::Dumper->Dump( [ $obj ]);

Try that and take a peek at the output.

HTH!

perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'