Thanks for the compliment. I see what you mean, though. What seemed to me to be a fairly simple deconstruction of the data turns into a fairly complex multilevel perl data structure.

The trick to understanding these (at least what worked for me) is to realize that arrays (and hashes) can only store scalars, not other arrays (or hashes).

Conveniently enough, references to arrays (or hashes) ARE scalars. So rather than an array of hashes (or hash of arrays, or whatever), you can have an array of hashrefs (or a hash of arrayrefs, etc.).

Looking at your data, the first thing that struck me (as it apparently did to several other respondents) was that the lines below 'mSTerminating' appeared to suggest a hash (key/value pairs).

Surmising (apparently correctly) that 'mSTerminating' was a type or descriptor name (i.e., that there might be more than one instance of it), I figured that there should be an array of references to the above hashes.

Finally, we need a hash to associate a reference to this array with the string 'mSTerminating'.

So the data itself suggests the structure: a hash which associates types (e.g., 'mSTerminating') with (a reference to) an array of instances, themselves represented by hashrefs.

Hope this helps.

dmm

Just call me the Anti-Gates ...

In reply to (Re) x 3: Non-fixed data in record by dmmiller2k
in thread Non-fixed data in record by brassmon_k

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.