in reply to Stable mixing of 2 arrays into a 3rd

'Somewhere', or towards the end of the created array? I'm thinking that you are exhausting one of the arrays long before you think you should, and shift off undef to stuff into the output.

Update: I changed the code lines:

my @t1 = map{ "T1/$_" } 1 .. 7, 42, 142, 242; my @t2 = map{ "T2/$_" } 1 .. 7, 43, 143, 243; and } 1 .. (7+7);
and ran that and occasionally saw:
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/143
so, yes, you are sometimes shifting off the end of an exhausted array.