Chah has asked for the wisdom of the Perl Monks concerning the following question:
The $VAR1->{x} field and $VAR1->{o} fields should both be 20x10 PDL's, and they're somehow saved as a very short section of code. Previously, when I tried to recreate the structure in memory, I got a segmentation fault error. And after some more experimenting, I'm now getting:$VAR1 = { 'totGrain' => 5, 'grain' => [ { 'vList' => [ bless( do{\(my $o = 143207480)}, + 'PDL' ), bless( do{\(my $o = 143300056)}, + 'PDL' ), . . . bless( do{\(my $o = 135713008)}, + 'PDL' ) ], 'gList' => bless( do{\(my $o = 143207224)}, ' +PDL' ), 'area' => 28, 'origin' => bless( do{\(my $o = 143321728)}, +'PDL' ), 'shape' => bless( do{\(my $o = 135712552)}, ' +PDL' ), 'mList' => bless( do{\(my $o = 143299624)}, ' +PDL' ), 'centre' => bless( do{\(my $o = 143319144)}, +'PDL' ) }, . . . ], 'time' => 26, 'N' => 10, 'x' => bless( do{\(my $o = 143273584)}, 'PDL' ), 'totGrainActual' => 5, 'NGrain' => bless( do{\(my $o = 143299000)}, 'PDL' ), 'grainMean' => 40, 'M' => 20, 'sumArea2' => 8248, 'grainSigmaByMean' => '0.17606816861659', 'sumArea' => 200, 'grainSigma' => '7.0427267446636', 'name' => 'Voronoi_20x10_5_0.2', . . .
Any suggestions on how I can save this large structure to disk and get it back? The saved file is coming out 3MB in size. I would actually prefer a more compact and faster to write & read format. So if someone knows a better way to do it, please help. ThxFatal error: argument is probably not a piddle, or magic no overwritte +n. You're in trouble, guv: 143374912 143324128 135000880
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Difficulty saving PDL's to disk with Data::dumper
by ELISHEVA (Prior) on Mar 01, 2009 at 11:20 UTC | |
by Chah (Initiate) on Mar 01, 2009 at 13:39 UTC | |
|
Re: Difficulty saving PDL's to disk with Data::dumper
by Anonymous Monk on Mar 01, 2009 at 12:35 UTC |