in reply to Why the same hex digest?
An observation: you don't have to open the file and read it in bit by bit. You can pass the opened filehandle directly to the Digest::MD5 object.
I posted some code a while ago that demonstrates the technique.