in reply to Hash-to-string

It sounds to me like you want the MLDBM module. Using MLDBM, you tie your multi-level data structure to a db file on disk. When you make a change to the structure in memory, it updates it in the db on disk. Voila! Instant persistance for hashes of arrays of hashes of references to arrays of scalars! Or whatever.

An example of how to use it:

use MLDBM; tie (%myhash, MLDBM, "filename", O_RDWR|O_CREAT, 0664); %myhash = { one => [0, 1, 2], employee => {serial_num => 1, name => "b +ob"}, mary => 7};
MLDBM uses Data::Dumper to do the serialization, and stores the resulting serialized structure into a db on disk.

Hope this is what you were looking for.

Alan

Replies are listed 'Best First'.
RE: RE: Hash-to-string
by merlyn (Sage) on Aug 18, 2000 at 06:24 UTC
    But beware of MLDBM when attempting to store things that exceed the DBM's limitation, like 2K for SDBM. Can really ruin a day. Also, MLDBM wants you to always change the top level hash to a completely new value. If you replace something lower, you'll never see it in the data structure.

    Because of these limitations, I prefer using Storable to throw the entire thing into a file on my demand, rather than try to manage the top level piecemeal.

    -- Randal L. Schwartz, Perl hacker