Hi,
My problem is to find the right tie::module.
The data is currently a shared hash of shared hashes. I would like to save it into files where first hash key is filename and second hash key+data is serialized to a file. It is like a cardfile.
I was hoping that there is some universal "tie to files" module but didn't find one which does this all without extra programming.
| [reply] |
Are you seeking to persist your data between runs of your program? Or offload the data to disk becuase of volume and memory constraints?
If the former, it should be relatively trivial and safe. If the latter, with threads involved, it requires considerable thought and care. You might look at DBM::Deep, though there doesn't appear to be any mention of thread-safety one way or the other. It can certainly handle the hashes of hashes aspect, and has ACID transactions which might mean it would work from multiple threads.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
I am looking for these features:
1) Persistent storage in user editable form which means text files indexed by filenames.
2) Shared storage between threads. That means file locking. It could copy the idea of lock() function.
3) Data amount is small enough for this kind of light database model. No internal caching needed or even allowed.
4) Data will be accessed by a tied variable like ${$key}{$subkey} which should point to file \somedatadir\key which contains subkeys like "subkey=>data" or something similar in a single file.
DBM:Deep looks interesting but I think it does not qualify my requirement n:o 1.
| [reply] |