in reply to Re: A simple game AI that learns
in thread A simple game AI that learns

I'm currently using Data::Dumper to simply write the contents of the memory to disk and to load them back in again when the program is restarted -- is there any specific reason I should be using Storable instead? I read the pod for it and it looks like it basically does the same thing I'm doing with Data::Dumper.

Replies are listed 'Best First'.
Re: Re: Re: A simple game AI that learns
by Fastolfe (Vicar) on Jan 14, 2001 at 08:23 UTC
    Data::Dumper actually expands the data structure into human- and perl-readable form, which requires re-parsing it when you want to use it again. Storable works more like serialization in Java, in that a portable binary representation of the Perl variable is made, preserving things like blessed references and the like. I suspect Storable is going to be a little more efficient if all you want to do is store and retrieve the Perl structure.