hello, I have this array called @finalarray, when i print the array using print "@array"; i get this:
PPA001P_Dalton beginningChanNumber.1 1 PPA001P_Dalton beginningChanNum +ber.2 2 PPA001P_Dalton beginningChanNumber.3 3 PPA001P_Dalton beginningChanNumber.4 5 PPA001P_Dalton chanSize.1 1 PPA +001P_Dalton chanSize.2 1 PPA001P_Dalton chanSize.3 2 PPA001P_Dalton chanSize.4 6 PPA003P_HunlockCrk beginningChanNumber.1 1 + PPA003P_HunlockCrk beginningChanNumber.2 2 PPA003P_HunlockCrk beginningChanNumber.3 3 PPA003P_HunlockCrk beginnin +gChanNumber.4 9 PPA003P_HunlockCrk chanSize.1 1 PPA003P_HunlockCrk chanSize.2 1 PPA003P_HunlockCrk chanSize.3 2 PPA003 +P_HunlockCrk chanSize.4 6 PPA004P_Springtown beginningChanNumber.1 1 PPA004P_Springtown beginningChanNumber.2 2 PPA +004P_Springtown beginningChanNumber.3 3 PPA004P_Springtown beginningChanNumber.4 7 PPA004P_Springtown chanSize +.1 1 PPA004P_Springtown chanSize.2 1 PPA004P_Springtown chanSize.3 4 PPA004P_Springtown chanSize.4 6 PPA008 +P_Greenfield beginningChanNumber.1 1
only a lot longer. HOwever, when i print it using:
foreach $item(@finalarray) { print "$item \n"; } <code> I get: <br> <code> chanSize.3 2 PPA001P_Dalton beginningChanNumber.1 1 PPA001P_Dalton beginningChanNumber.2
with all kinds of unexpected values in this array, so when i want the 5th item in the array and i do a  $finalarray[5], i dont get the 5th variable, but a blank space. Any ways i can fix this?
Thanks In advance
Dipul Patel

In reply to Unexpected Array by ImpalaSS

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.