Loading ...
Sorry, an error occurred while loading the content.

saving a hash of hashes

Expand Messages
  • payne_mike
    What do you guys think is the quickest and most convenient way to save a hash of hashes to a file or database system? Setting one up isn t a problem, but
    Message 1 of 2 , Mar 27, 2002
    • 0 Attachment
      What do you guys think is the quickest and most convenient way to
      save a hash of hashes to a file or database system?

      Setting one up isn't a problem, but keeping it persistent gets a bit
      trickier. I could design a system that would write it to a text file
      and then load it from the text file, but I'm betting that once a
      significant amount of data is in the database, it will be horribly
      slow and inefficient.

      Anyone done this before and have a good tactic they can share?
    • Fergus Cameron
      ... tie the primary hash to the database file using tie && DB_File then use the Storable package to freeze & thaw the hash contents from the tie d primary.
      Message 2 of 2 , Apr 1, 2002
      • 0 Attachment
        > What do you guys think is the quickest and most convenient way to
        > save a hash of hashes to a file or database system?

        tie the primary hash to the database file using tie && DB_File then use
        the Storable package to freeze & thaw the hash contents from the tie'd
        primary.

        very simple & fast enough for everything i've need it for.

        if you still have performance overheads here then get you can create
        secondary index db files for searching (i.e. so you don't have to thaw
        every hash just to search the 'name' field for example.)

        > Setting one up isn't a problem, but keeping it persistent gets a bit
        > trickier. I could design a system that would write it to a text file
        > and then load it from the text file, but I'm betting that once a
        > significant amount of data is in the database, it will be horribly
        > slow and inefficient.

        yup - i've certainaly had that problem before.

        good luck.
      Your message has been successfully submitted and would be delivered to recipients shortly.