in reply to Population of an array

<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.