FAQ
Is there an easier way than MLDBM? It's all I've found. I need to
store/retreive a DBM hash with 7 keys, each key storing an array with up to
40 entries.

Or can I tie multiple hashes to one DBM file? Then I could reference each
entry as a key in it's respective hash.

ANY help would be appreciated.

Search Discussions

  • Bob Showalter at Aug 23, 2001 at 12:47 pm

    -----Original Message-----
    From: G Harper
    Sent: Thursday, August 23, 2001 2:58 AM
    To: beginners@perl.org
    Subject: How to tie a hash of arrays


    Is there an easier way than MLDBM? It's all I've found. I need to
    store/retreive a DBM hash with 7 keys, each key storing an
    array with up to
    40 entries.
    It very much depends on the specific application. It really doesn't
    get much easier than MLDBM. I don't understand what the problem is.
    Or can I tie multiple hashes to one DBM file? Then I could
    reference each
    entry as a key in it's respective hash.
    No, a DBM ties to one hash. But that hash (using MLDBM) can
    contain other hashes nested to any level.

    Post some details about why MLDBM doesn't seem to be the right
    tool for you.
  • G Harper at Aug 23, 2001 at 1:29 pm
    "Bob Showalter" <Bob_Showalter@taylorwhite.com> wrote in message
    Is there an easier way than MLDBM? It's all I've found. I need to
    store/retreive a DBM hash with 7 keys, each key storing an
    array with up to
    40 entries.
    It very much depends on the specific application. It really doesn't
    get much easier than MLDBM. I don't understand what the problem is.
    Or can I tie multiple hashes to one DBM file? Then I could
    reference each
    entry as a key in it's respective hash.
    No, a DBM ties to one hash. But that hash (using MLDBM) can
    contain other hashes nested to any level.

    Post some details about why MLDBM doesn't seem to be the right
    tool for you.
    I'm relatively new to Perl in the first place, and I've been trying to find
    portable solutions whenever possible.
    I am writing my script on one machine, testing it on another Unix machine
    and it will be launched on a third so if there was a reasonable alternative
    that didn't require the use of an external module it would be preferable in
    this situation. Also I find I learn a heck of a lot more when I try and
    roll my own solutions...

    The only alternative I can think of would be to index all the hash names
    with a numeric identifier and parse them all into a hash of arrays when I
    read the DBM... but that's probably more work than it's worth.

    Thanks for the input :-)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedAug 23, '01 at 3:57a
activeAug 23, '01 at 1:29p
posts3
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase