foreach (0 .. $#lines) { # print from file A # print from file B }