in reply to compare images

Hash functions like MD5 can have collisions.

That's no excuse, just choose a better hashing algorithm like sha-512. It's really a comprimise between speed and security. Md5sum will be faster, some low-bit sha has been reported to have collisions, but high bit sha, and others like doing "shasum -512 $file" will not give you collisions in any real setting.

In the interest of speed, you can use the lowest hash, a 16-bit checksum, like "sum $file", which is very fast. Then only if the sums match, do a sha-512 or md5sum.

To your original question of comparing images, the Imager::Filter module (part of Imager ) can detect differences, which you can probably use for deeper comparison.

$out = $img->difference(other=>$other_img);

I'm not really a human, but I play one on earth. flash japh