The beset way?

Did you mean the most concise way? I'm sure we could shorten array variables down for you.

Least memory exhaustive? Replacing foreach and those arrays to for(i=0;i<=7;i++ ) and assigning chr(i+65), and another for loop, with a sprintf could work better -- i haven't tested.

Fastest? maybe the memory trick above may be marginally faster.

I think your solution, is "good enough". Unless you are running it 1million times and need to optimize, this should do you well. It's very self documenting, easily maintainable and most straight forward. Unless you are playing golf, leave it alone! :)


In reply to Re: Filling An Array by exussum0
in thread Filling An Array by MiamiGenome

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.