i need to compare 2 text files and find data in file2 that no present in text file1. problem how find diffirences between files. i start write in perl: #!/usr/bin/perl -w open(SALES,"text1.txt"); open(SALES2,"text2.txt"); while (($line= <SALES>)&&($line2= <SALES2>)) { print $line2; } close SALES;
There are tools available for doing it... I wonder why you need a code to compare it. A sample code Synopses use File::Compare; if (compare("file1","file2") == 0) { print "They're equal\n"; } Code (markup):