Unfortunately, you have edited your code TOO much. We really need to see more to understand exactly what you are trying to do. The questions arise because you don't seem to have real values in your @SList array. Those appear to be headers that could be used in a Two Dimensional array or they appear to be keys that could be used in an Array of Hashes. You really need to provide more code and more context.

Additionally, there seems to be some confusion on your end about what qw() is used for -- you question whether or not you should be using scalars instead, without realizing that you already are using scalars. qw() is merely a convenience function that allows us lazy programmers to leave out quotations and commas when creating hard coded arrays, like so:

my @hard2type = ( 'one', 'two', 'three', 'four' ); my @ez2type = qw( one two three four );

Finally, perhaps you can elaborate what you mean when you said "... write a foreach loop that will go over each line in the list ..." because as it stands, you have only presented one line, not many. Thanks!

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to Re: (Beginner) Can 'qw' be implemented into a list? by jeffa
in thread (Beginner) Can 'qw' be implemented into a list? by Halbird

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.