There are gobs and heaps of cool little Perl tricks that I am ignorant of... this is by virtue of the fact I have done most of my developing until recently in solitary ("solitary" meaning "alone," not "in the hole"). I believe that this is one of those nuggets of info:

Is there an easy way to "serialize" a Perl hash as one can do with objects in Java? If you don't know what serializing is, it's like this... serializing is converting an object to a string which can be stored on disk easily... and when this string is sent to the "deserializer-o-matic," it becomes a whole object again.

For my purposes, the hash may contain refs to hashes, refs to arrays, scalars, or any mixture of the three... and at any depth (the hash can contain a ref to an array of arrays of hashes, etc. No built-in limits, eh!) If no one knows of a relatively easy means to do this, don't feel compelled to write up a sophisticated method for accomplishing it... I can certainly figure it out. I just want to make sure I'm not re-inventing the wheel if I whip one up.

Thanks a bunch,

Alan "Hot Pastrami" Bellows
-Sitting calmly with scissors-

In reply to Hash-to-string by Hot Pastrami

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.