Hi, I have a text file, from which I have parsed some strings like this :

LB split2 1e38 split1 -0.43092 + (4.788 * W) M2 split2 L < 10 AND W < 1.080 split1 (-0.665364 + (9.6216 * W))*(10/L +) split1 -1.38618 + (20.045 * W) split2(L < 10 AND W >= 1.080) OR (L +>= 10 AND W > 0)split1 -0.665364 + (9.6216 * W) split1 -1.38618 + (20 +.045 * W) M1 split2 L < 10 AND W < 1.080 split1 (-0.665364 + (9.6216 * W))*(10/L +) split1 -1.38618 + (20.045 * W) split2(L < 10 AND W >= 1.080) OR (L +>= 10 AND W > 0)split1 -0.665364 + (9.6216 * W) split1 -1.38618 + (20 +.045 * W)

Now, I want to split this string and want to store it in nested hash..Like this
%metals = ( # $metal-level1 ==> { # LENGTH_RANGES ==> @length(L1,L2) # WIDTH_RANGES ==> @width(W1) # EM_POLY ==> {
<>

LB, M1 and M2 are metal lines and then I have width and length of metals and polynomial equations. I have extract all these values and stored in arrays, But as I am new to perl, So, I couldn't figured out that how can I store those values in 3D hash structure. I am using these keywords split1, split2 to split the string into different arrays for length, widths and so on.

I am not asking for a solution, but just an idea that how can I make a 3d hash structure for the given text. Thanks


In reply to Multidimentional hash by freekngeek

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.