http://www.perlmonks.org?node_id=395813


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

All exceptions occur when T2/7 is output before T1/7.

You are checking that @t1 is not empty, but not @t2.

Changing the final ternary operator expression to : @t2 ? \@t2 : \@t1 fixes this.

Regards,

PN5