use File::Compare to compare two files : File « System Functions « Perl






use File::Compare to compare two files

   

use File::Compare;

if (compare("file1.txt","file2.txt")) {

    print "Those files are not equal.\n";

} else {

    print "Those files are equal.\n";

}

   
    
    
  








Related examples in the same category

1.Get the basename of a file
2.Get the dirname from a file name