Quote:
Originally Posted by crmpicco
Can anyone tell me what the freeze function is doing in this code?
Code:
use Storable qw(freeze);
freeze($list->[0]);
I think it returns a large binary result or something
Picco
www.crmpicco.co.uk
www.ie7.com
|
Its storing a serialized version of the object for later retrieval. Storable is usually used when you want to store a data structure for later use -- generally called persistence. But freeze and thaw do the same thing in memory, which is normally used for interprocess communication and whatnot. The manual at:
http://search.cpan.org/~ams/Storable...m#MEMORY_STORE is informative:
Quote:
|
This is mainly used to freeze a complex structure in some safe compact memory place (where it can possibly be sent to another process via some IPC, since freezing the structure also serializes it in effect). Later on, and maybe somewhere else, you can thaw the Perl scalar out and recreate the original complex structure in memory.
|