<sigh>...
Spent too long writing this, but still,
Ah ... where to start?

Foreach'ing a regex ???
    ... what M$ calls "smart quotes" in the (sic) Print statement?
      ... in effect, emptying your @ray each time thru the foreach (note my capitalization)???
        ... no hint of strict or warn?
or the ambiguous sample data... is your data really filled with proprietary tags? If so, what are the rules of "well_form-edness?" ...or the failure to wrap your sample data in code tags to make it easier to read? or ? or ??
    ...</sigh>

But a few suggestions, anyway, because the Monastery truly welcomes newcomers. The catch is: we do tend to say "please, read the docs" or somewhat more tersely, "RTFM!" Perhaps you are indeed just "playing around" but even so, asking your question with some indication you're trying to at least nod in the direction of our norms will get you better and more useful replies.

As for reading/study: there is such a wealth of good, free information here, or by way of googling for (perl + tutorial), that I hesitate to even try to be more specific. Find something presented in a manner that fits your taste and learning mode, and -- as questions arise -- bring them here.


In reply to Re: Population of an array by ww
in thread Population of an array by gzayzay

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.