open(my $fhtwo, "<",$in_file2) or die $!; while (my $line2 = <$fhtwo>) { ...; } close $fhtwo;