in reply to rewinding filehandle/line skipping ?

The problem is, for some reason the program is skipping every other line in DATA2.

The problem is that you are reading two lines, but working on only one of them, replace

while (<DATA2>) { $line=<DATA2>;
with:
while ($line = <DATA2>) {
I think your code would benefit from use strict; and some lexical scoping. The pronoun $_ instead of $line might help too.

After Compline,
Zaxo