in reply to Fastest way to store and retrieve configuration information?

Take a look at Storable.


DWIM is Perl's answer to Gödel
  • Comment on Re: Fastest way to store and retrieve configuration information?

Replies are listed 'Best First'.
Re^2: Fastest way to store and retrieve configuration information?
by Booger (Pilgrim) on Nov 30, 2005 at 19:56 UTC
    GrandFather:

    Thank you for your suggestion.

    From what I can tell, Storable is at least twice as fast as the XML-method I was using and I don't have to import any more large XML modules into my web app namespace, either. I like it.

    Only one question now remains: is storable safe in terms of cross-platform (i.e. Linux to Mac OS X) and cross-architecture (i.e. 32-bit and 64-bit)?

    I didn't see anything in the Storable POD that would indicate otherwise but I was just wondering if you knew off the top of your head.

    Thing is, I'm going to want to generate the "storable" file on a 32-bit Linux server and use it on 64-bit Linux servers and Mac OS X machines.

    Any thoughts?

    Thanks again,

    Matt

      The following is of interest:

      You can also store data in network order to allow easy sharing across multiple platforms, or when storing on a socket known to be remotely connected. The routines to call have an initial n prefix for network, as in nstore and nstore_fd. At retrieval time, your data will be correctly restored so you don't have to know whether you're restoring from native or network ordered data. Double values are stored stringified to ensure portability as well, at the slight risk of loosing some precision in the last decimals.

      so if you use the n prefixed functions the data is serialised in network order so should be fine across architectures.


      DWIM is Perl's answer to Gödel
        Guess I should have RTFM a little more, eh?

        Thanks again!