My understanding is that Storables are not necessarily portable between machines, even when using nstore.

Care to elaborate on that. What have you heard and where?

There are going to be some situations where portability isn't possible.

  1. Data packed with the latest version probably won't be portable to a machine running an ancient version.

    As perl (and the rest of the world) have adapted to new requirements (unicode for example), those adaptations inevitably break backwards compatibility. But ditto for any transfer format pre- and post-unicode support.

    If you use newer features--like coderefs; then portability will be restricted by the features used by that code. say won't work pre-5.10.x; but neither will Java5 code compile on a Java3 compiler.

  2. 64-bit integers won't port to a 32-bit machine.

    But even a text format file will have this problem. A 32-bit machine will bottle out trying to read a > 32-bit integer, even if it is formatted as text.

  3. The target machines will need to have the appropriate modules to support stored blessed refs.

    This wil be the same whether you use Storable, Yaml, or Data::Dumper.

Often the solution to these types of problems is to consider what your portability requirements actually are, rather than seeking "universal portability". It's often a variation on YAGNI.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

In reply to Re: Portable datastore formats in core perl? by BrowserUk
in thread Portable datastore formats in core perl? by rastoboy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.