RE (tilly) 1: Data::Dumper
by tilly (Archbishop) on Sep 11, 2000 at 03:42 UTC
|
Stupid Data::Dumper trick. Set $Data::Dumper::Indent to 1
and dump a reference to a data structure. What you get is
readable to humans, and makes a very convenient format for
a configuration file. Just do the file to read the
configuration. No work definining a format. No worries
about whether or not everything is escaped... | [reply] |
RE: Data::Dumper (Adam: Sample Usage)
by Adam (Vicar) on Oct 27, 2000 at 23:00 UTC
|
I'm always forgeting the way to get Data::Dumper to print a hash and put the name of the hash in-place of the "$VAR". So this is as good a place as any to stick it where I can find it quickly, and other people can see an example usage.
use strict;
use Data::Dumper;
my %hash = ( 'some' => 'stuff' );
print Data::Dumper->Dump([\%hash], ["hashname"]), $/;
| [reply] [d/l] |
|
| [reply] [d/l] |
RE: Data::Dumper
by Anonymous Monk on Nov 10, 2000 at 06:51 UTC
|
Another Data::Dumper trick-
For quick and dirty state persistence over multiple
invocations of a program, use a single hash for all your
state info. Dumper() a reference to it into a file when
the program exits, and require() that file the next time
the program starts up.
booom. You're right back where you left off.
| [reply] |
RE: Data::Dumper
by lachoy (Parson) on Oct 18, 2000 at 03:13 UTC
|
Big 'me too' along with tilly for using Data::Dumper
for configuration files.
In addition I must say that my debugging life would be much
more painful in a world without Data::Dumper. Curious about what's
in that hairy list of hashes of lists of hashes?
Just Dump It!
All hail Data::Dumper!
| [reply] |
|
| [reply] |
|
| [reply] |
Re: Data::Dumper
by premchai21 (Curate) on May 07, 2001 at 21:10 UTC
|
| [reply] |
|
Look At Data::TreeDumper. Muchhh more readable.
| [reply] |