wishartz has asked for the wisdom of the Perl Monks concerning the following question:
I can populate the array of hashes, but how do I dump it? I have tried the following, but it doesn't work:disk_stats[array_index]{key}=value
How would I read it back into a program as well? I have read the documentation for Data::Dumper, but still cannot figure out how to do it? Thanksopen (FILE, "> diskstats.perldata") or die "can't open diskstats: $!"; print FILE Data::Dumper->Dump([\@disk_stats]); close FILE or die "can't close diskxstats: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Data::Dumper to dump an array of hashes to a file
by kyle (Abbot) on Aug 14, 2008 at 16:26 UTC | |
by wishartz (Beadle) on Aug 14, 2008 at 17:32 UTC | |
by wishartz (Beadle) on Aug 14, 2008 at 17:37 UTC | |
by alexm (Chaplain) on Aug 14, 2008 at 22:06 UTC | |
by kyle (Abbot) on Aug 15, 2008 at 01:21 UTC | |
by alexm (Chaplain) on Aug 15, 2008 at 07:47 UTC | |
|
Re: Using Data::Dumper to dump an array of hashes to a file
by Your Mother (Archbishop) on Aug 14, 2008 at 18:42 UTC | |
|
Re: Using Data::Dumper to dump an array of hashes to a file
by planetscape (Chancellor) on Aug 15, 2008 at 05:07 UTC |