in reply to MLDBM

MLDBM actually ISA TieHash, and implements the interface. At the time, you serialized the data structure into MLDBM file, you did a tie. When you read it back, do the same tie again, without specifying O_CREATE. The content of your MLDBM file will be fetched into the Tied Hash (this is transparent to you), now you can used the tied hash, and it supports all the stanbard methods you can apply on a hash.

Replies are listed 'Best First'.
Re: Re: MLDBM
by pg (Canon) on Nov 15, 2002 at 05:29 UTC
    do something like this: (Assume you have a hash that has two pairs: "a" => 1, and "b" => 2. You can have a much much more complex structure than this sample)
    use Fcntl; #so perl understand what is O_RDONLY use MLDBM; tie %hash, 'MLDBM', 'file', O_RDONLY, 0666; print $hash{"a"}; print $hash{"b"};


    it would print 12.