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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |