in reply to dbmopen and hashes of hashes

dbm can't store anything but strings. So it converted your second level hash to a string. If you need to store things like this, consider combining Storable with dbmopen. First use freeze from Storable to turn the object into a string. Then store that via the dbm hash. Later, use thaw to get the data back.

Phil

Replies are listed 'Best First'.
Re^2: dbmopen and hashes of hashes
by jgallagher (Pilgrim) on Oct 13, 2005 at 14:36 UTC

    One thing to be careful of (that bit me when I did this) is that some DBMs limit the length of string that they can store. I believe I ran into a 1024-character limit, which is clearly not all that long.

    You can certainly work around this; I ended up using two tables. The actual data is split up into 1000-character chunks and a separate table is used to index into that for reconstruction. A better solution would be DBM::Deep, which handles all of this for you. :-)

Re^2: dbmopen and hashes of hashes
by mulander (Monk) on Oct 13, 2005 at 14:48 UTC
    Thank you, Storable is doing great! I wasn't even aware of it's existance and thanks to you I may consider my problem solved. Thanks again.