open my $fh1, '<', 'file1.txt' or die "can't open the damned 'file1.txt' file!: $!"; open my $fh2, '<', 'file2.txt' or die "can't open the bloody 'file2.txt' file!: $!"; #### my @file = <$fh>; foreach $row (@file){ ... #### while (my $row = <$fh>){ chomp $row; # remove line ending ...