in reply to Digest::MD5::md5_hex giving different values on different machines

Lots of good possibilities already mentioned that I wouldn't have thought of, but don't forget a very simple one:

Do both data sources have (or both not have) a trailing newline?

The first time I used MD5 for storing passwords, I spent a while banging my head against the wall trying to figure out why the same test passwords would generate one hash in the command-line tools and a different one from Perl. Appending a "\n" to the password before passing it to md5_hex fixed that right up. (Not that this is terribly likely in your case, since you appear to be working from a file rather than a plain string, but I'll mention it for completeness.)

  • Comment on Re: Digest::MD5::md5_hex giving different values on different machines