all the hash can be written at one time rather than one record at a time.
Therefore using a DBM seems to me to be too expensive in terms of memory, time, understanding,
ease of use, maintainance, and safety.
I once found out (after many hours of grubbing into DBM stuff) that writing to and reading from a text file is the
most easy way to store an entire hash.
Bart Lateur wrote:
On Fri, 22 Oct 2004 02:32:09 +0200 (MEST), Louis Pouzin wrote:
I have a data base of IP/domain names that I maintain as plain text files. The size is only a few hundred K octets.
I use a hash (of of hashes) for various searches. Building the whole hash takes a few seconds.
As the ratio of updates/searches is in the order of 1/15, I'd like to restore the whole hash from a file, in view of shortening response time when doing searches.
Is there some routine/package such as "save/restore %H,FileHandle" ?
Depending on how much data you actually want to look at and/or change, you might actually be wanting a tied hash, the thing perl4 had dbmopen() for. Now, you could think of using some DBM package (SDBM, NDBM, etc), BerkeleyDB, or DBM::Deep. I'm not sure what exactly is available for MacPerl, but I think that is the route you should try out.