in reply to Best way to compare two files
Your example is actually incorrect. Because "A big bad witch lived inside" is what you expect to be seen as the same. However, they are on different lines, and thus not the same. Your output can only be true if no line will be repeated and you scan each file for each line in the other. ie
while(<ONE>) { my $line = $_; while(<TWO>) { print "different" if (!/$line/); } }
|
|---|