in reply to Compare Binary Files

If all you want is to check whether the files have identical content or not I would simply compare the MD5 (or SHA-1) hashes.

Hash::MD5 will calculate the hash for you.

Replies are listed 'Best First'.
Re^2: Compare Binary Files
by ikegami (Patriarch) on Sep 07, 2011 at 23:12 UTC

    Why? It seems to me that reading entire file to calculate its hashes is a waste of time compared to just reading the entire file.

    Calculating hashes is useful in two circumstances: 1) When comparing one document to many (or many to many), 2) When a compact signature of the file is needed (for ease of communication or storage).