in reply to Re^6: Using Splice with Two Arrays within a loop
in thread Using Splice with Two Arrays within a loop

The code for  sub interleave_words { ... } in hdb's reply is an alternative definition of the subroutine. Put it in place of the definition of the subroutine of the same name you have here.