in reply to Storable retrieve

How are you storing the information to begin with? Do you mean you're using the Storable module to serialize the information first? If so, then I can't see why (or how) you'd then insert that into a DB_File. If on the other hand you're merely inserting a normal hash into a DB_File, then (from the documentation), use tie to load the data into a hash and merely foreach as normal over the keys:

tie %hash, 'DB_File', [$filename, $flags, $mode, $DB_HASH]; foreach (keys %hash) { ... }

Alternatively, after tie'ing the hash, you can use:

$hash->get($key, $value [, $flags]);

Replies are listed 'Best First'.
Re: Re: Storable retrieve
by PodMaster (Abbot) on Nov 07, 2002 at 09:44 UTC
    Alternatively, after tie'ing the hash, you can use:
    $hash->get($key, $value [, $flags]);
    But only if you define $hash ;)
    my $hash = tie %hash, 'DB_File', [$filename, $flags, $mode, $DB_HASH] +; $hash = tied %hash;
    If you do use $hash, you must be sure to undef it before you untie %hash, see the untie gotcha part of the DB_File documentation.

    ____________________________________________________
    ** The Third rule of perl club is a statement of fact: pod is sexy.

Re: Re: Storable retrieve
by Anonymous Monk on Nov 07, 2002 at 04:59 UTC
    Basically i want to store
    a hash directly in to an MLDBM
    I thgt using Storable will be faster
    But it is as the same speed as Data::Dumper
    hence if u can suggest something
    Thanks