in reply to a few basic questions

  1. if ($num % 2) { # This is an odd num
  2. Use the same loop for both files, like:
    foreach (0 .. $#lines) { # print from file A # print from file B }
  3. Have you tried it out?

------
/me wants to be the brightest bulb in the chandelier!

Vote paco for President!