in reply to Re^2: Combining Files using Hash
in thread Combining Files using Hash

Why does this happen?

Maybe you have some blank lines at the end of the file. Add a check like this

while (my $line1 = <$file2>){ next unless ($line1 =~ /\S/); # skip empty lines chomp $line1;
poj