Thank you for the fast reply. I wanted to use hash at first so the key is group and the value is an array of values. But the problem is that this format should be of JSON that will be sent to Mongo and Mongo does not allow dots and the dollar sign to be in the key name. But we want to allow those special chars to be in groups so we had to rechange the structure and they can't be keys. I can't see any other structure than the one I suggested in the post.

Anyway, I know that I keep pushing it each time, my question here is how I can make sure it gets to the right place? I'll have to iterate over the array and that does not feel efficient. Maybe you can suggest how the structure should look like? Thanks again!

In reply to Re^2: Trying to make the code more clear and clean by ovedpo15
in thread Trying to make the code more clear and clean by ovedpo15

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.