I think the problem you are trying to describe is the one caused by

foreach (@array0,@array1,@array2,@array3,@array4,@array5) { @shift0 = shift @array0; @shift1 = shift @array1; @shift2 = shift @array2; @shift3 = shift @array3; @shift4 = shift @array4; @shift5 = shift @array5; ... }

That line loops over every element of @array0, then over every element of @array1, then ... @array5. This is further complicated by the fact that you modify those arrays in the loop (a big no no).

A solution:

push(@array0, $general[0]); push(@array1, $general[1]); push(@array2, $general[2]); push(@array3, $general[3]); push(@array4, $general[4]); push(@array5, $general[5]); ... while (@array0) { my $shift0 = shift @array0; my $shift1 = shift @array1; my $shift2 = shift @array2; my $shift3 = shift @array3; my $shift4 = shift @array4; my $shift5 = shift @array5; ... }

Like many other things in your program, that can be simplified to:

push(@array, [ @general ]); ... foreach my $general (@array) { my ($shift0, $shift1, $shift2, $shift4, $shift5) = @$general; ... }

In reply to Re: Misprocessed Read From Files? by ikegami
in thread Misprocessed Read From Files? by Napa

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.