Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Fastest way to store and retrieve configuration information?

by Booger (Pilgrim)
on Nov 30, 2005 at 19:56 UTC ( #513077=note: print w/ replies, xml ) Need Help??


in reply to Re: Fastest way to store and retrieve configuration information?
in thread Fastest way to store and retrieve configuration information?

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


Comment on Re^2: Fastest way to store and retrieve configuration information?
Re^3: Fastest way to store and retrieve configuration information?
by GrandFather (Cardinal) on Nov 30, 2005 at 20:24 UTC

    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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://513077]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-12-25 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls