If you just want to compare two files (and no n-way comparisons) File::Compare can be much faster than calculating a hash because it can abort at the first difference, while the hash algorithm always has to go through both files entirely.