in reply to Need a module for persistence of dynamic objects

In my experience: Data::Dumper is not really suitable because it needs to be eval'ed when you read it.

FreezeThaw works, but it can get VERY slow when you have a lot of hash keys.

Storable is superb, really a reference implementation. It is by the FreezeThaw author, but in C, and much faster. I think it should be a core perl module: serialization is becoming important nowadays.

Other possibilities: Yaml, XML::Dumper ...

General warning. I don't think there is yet a way to serialize coderefs, compiled regex's, or (unsurprisingly) handles. These can bite you in the bum sometimes.

dave hj~

  • Comment on Re: Need a module for persistence of dynamic objects

Replies are listed 'Best First'.
Re: Re: Need a module for persistence of dynamic objects
by theguvnor (Chaplain) on Feb 12, 2002 at 17:03 UTC
      Good point. I also forgot about Data::DumpXML which I have used once or twice and seemed cool. But unless you need to use XML, I'd stick with Storable.

      dave hj~