First of all, you'll need to understand which components are hashes and which components are arrays in your data structure. It looks like you were able to apply some of the responses to your earlier question (XML:Simple Config). That's a good start.

Secondly, you need to determine at which level of your data structure are you wanting to looping through. If that level is an array, it should be simple to iterate through that level with a for loop or a foreach loop. If that level is a hash, you can look at perlfaq4 for an example of how to iterate through a hash.

However, I should point out that grantm gave you a reference to Perl documentation about complex data structures (perlreftut) in response to your earlier question (XML:Simple Config). You might find that information useful in dealing with your complex data structure.

Also, I should point out that if you don't like the default structure that XML::Simple creates, there are some options in that module that you could use to modify how it will create the data structure.


In reply to Re: Loop through hash structure by dasgar
in thread Loop through hash structure by PerlScholar

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.