Of course. The real input files have many more variables, but I've tried to simplify both the code and input files without losing the main point of the script. By match, I just mean does $FILE1letter equal $FILE2letter, as in A==A. By no match, I mean $FILE1letter = A and $FILE2letter=B, so A!=B. The goal of the real script is really not to just print matches and mismatches, but to do many things within each conditional, but I realized that my if statement was not working correctly, as it was printing even when there was no match and I think the larger problem is the looping structure of the entire code. Thanks for the help.