in reply to tie::hash files..

You may want to have a look at Tie::File, which has a read cache and deferred write mode. (It ties an array to lines in the file; you would want to munge it to tie a hash based on the key.) But the caching isn't going to work for you if you really need simultaneous access.

You've constrained your problem so well it becomes hard to solve except with whole-file writes on every change. About the only thing I can think of that would help would be to have a maximum record length, and pad the end of each line out to that length. Then you can update a single line on each STORE. But it makes it easy to mess yourself up when you directly edit the file.

Replies are listed 'Best First'.
Re: Re: tie::hash files..
by bugsbunny (Scribe) on Jan 13, 2004 at 07:47 UTC
    thanx alot it seems i'm doomed :")

    it seems i will be better of doing lock until some of my scripts work and accumulate changes and at the script end do a flush..and unlock.(they are short quick scripts)
    If I place flush logic in the DESTROY method will it be called when the script exits.(if i forgot to do it)..
    I mean if I forgot to untie.

    tia