http://www.perlmonks.org?node_id=1031228


in reply to ignore duplicates and show unique values between 2 text files

The reason of your problem is the newline character. It is considered a part of the line you read in, but it is not present on the last line in each file. Therefore, '121' plus newline is not the same as '121' without a newline.

Use chomp to get rid of newlines:

while (my $line = <FILE>) { chomp $line; # ...
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ