in reply to Running two loops
use strict; use warnings; [download]
It would certainly be easier to help you.