in reply to risk of confusion

steph_bow,

If you're concerned that that the $_ variable is going to get clobbered, try reading/assigning each line into a variable, as in:

while (my $file_1_line = <INFILE>) { ... do stuff }

BTW, your code would be much more readable (to Perlmonks) if you only included the relevant code that demonstrates your particular issue. You might consider weeding it down to about 10-15 lines, with not so many comments, as they don't aid in increasing my understanding of the problem at hand.

Update: Added a number to the variable name


Where do you want *them* to go today?