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

Re: [PBML] saving a hash of hashes

Expand Messages
  • 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 1 of 2 , Apr 1 4:38 PM
    View Source
    • 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.