do { if(grep($genes[$index],@gl)) { print O "$genes[$index]\n"; $index++; } else { $index++; } } until($index==@genes);