in reply to Re: Re: Need help with complex tied data structure
in thread Need help with complex tied data structure

The fragment I posted also stresses out the importance of storing back the modified value in the top level hash. Your code doesn't do that.

Abigail

  • Comment on Re: Need help with complex tied data structure

Replies are listed 'Best First'.
Re: Re: Need help with complex tied data structure
by genecutl (Beadle) on Nov 21, 2003 at 00:31 UTC
    I see your point. So, then I should do this:
    $tmp = $data[$gid]->{$id}; $tmp->[$element_num] = $element; $data[$gid]->{$id} = $tmp;
    I haven't tested this yet, but while typing it, I noticed that with the $tmp assignment, that I'm pulling all of @{$data[$gid]->{$id}} into memory, partly obviating the advantage of the disk-based tie. It would make more sense then to generate the entire @{$data[$gid]->{$id}} array in memory and only save it when all the elements are computed. Is that correct?