in reply to Re: Re: Problem storing value in persistent hash with MLDBM
in thread Problem storing value in persistent hash with MLDBM

It's really not an issue of the storage mechanism (dbm vs. RDBMS), just a simple problem with Perl's TIE mechanism. In your case, I would change it so that you always write to $sessions->{$session_id} when you modify anything in the session. For example:
my $aref = $sessions->{$session_id}; $aref->{timestamp} = time; $sessions->{$session_id} = $aref;

Replies are listed 'Best First'.
Re: Re: Re: Re: Problem storing value in persistent hash with MLDBM
by relax99 (Monk) on Oct 08, 2002 at 14:55 UTC

    That's basically what I have done. I have insert_key() method, which updates $session object, but also updates the tied %{$sessions} variable. You can only see and refer to $session object from the main screen, the update of tied hash structure %{$sessions} happens when you call $session->insert_key().