yoda54 has asked for the wisdom of the Perl Monks concerning the following question:
I can't seem to restore a object that was previously serialized. Do I need to re-bless?
Thanks for any help!!
Restoring :
Saving object:#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use SomeObject; #is this needed? local($/) = undef; open(D, "data.txt"); my $n = <D>; eval( Dumper($n) ); $n->show();
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use SomeObject; my $n = SomeObject->new(datta => "foo", data2 => "foo2"); open(D, ">data.txt"); print D Data::Dumper::Dumper($n);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Restore serialized objects
by GrandFather (Saint) on Mar 18, 2010 at 06:42 UTC | |
|
Re: Restore serialized objects
by chromatic (Archbishop) on Mar 18, 2010 at 04:23 UTC | |
by yoda54 (Monk) on Mar 18, 2010 at 05:25 UTC |