in reply to Stable mixing of 2 arrays into a 3rd
Update: I changed the code lines:
and ran that and occasionally saw:my @t1 = map{ "T1/$_" } 1 .. 7, 42, 142, 242; my @t2 = map{ "T2/$_" } 1 .. 7, 43, 143, 243; and } 1 .. (7+7);
C:\Archive\Perl\Mine\play>perl -w browseruk1.pl 14 :T2/1 T1/1 T2/2 T2/3 T1/2 T2/4 T1/3 T2/5 T2/6 T2/7 T1/4 T1/5 T2/43 T2/143 14 :T1/1 T2/1 T2/2 T1/2 T2/3 T2/4 T2/5 T2/6 T1/3 T1/4 T1/5 T2/7 T2/43 T1/6 14 :T1/1 T2/1 T1/2 T1/3 T2/2 T1/4 T1/5 T1/6 T2/3 T1/7 T1/42 T2/4 T1/142 T2/5 14 :T2/1 T1/1 T2/2 T1/2 T1/3 T2/3 T2/4 T1/4 T2/5 T2/6 T2/7 T2/43 T1/5 T2/143 14 :T1/1 T1/2 T1/3 T1/4 T1/5 T1/6 T1/7 T1/42 T1/142 T2/1 T2/2 T1/242 T2/3 T2/4 14 :T2/1 T2/2 T2/3 T1/1 T2/4 T1/2 T2/5 T1/3 T2/6 T1/4 T2/7 T1/5 T2/43 T2/143so, yes, you are sometimes shifting off the end of an exhausted array.
|
|---|