One of my little tools failed today. You see, I have this small irssi script and a small dancer app that allow me to post microblog messages from IRC to my website. You can read them here.
For some pseudo security I use a shared secret between the two scripts, which is the base for a hashed "token" to authorize a message. And for some strange reasons, I got different tokens on my sending machine and on the receiving machine.
After some debugging I finally found the problem: The same string (which gets URI-encoded before submitting it) and the same secret generated a different hash. Digest::SHA1 wasn't the culprit, so it seems that URI::Encode was causing problems. Or rather, the fact that I had two different version of URI::Encode installed on the two different machines.
So a quick
cpanm URI::Encode later, everything was working fine and dandy.
Lesson: If you're doing some communication between different machines, make sure they both use the same versions of modules used to encode/decode/transfer data, before ripping up your code and sprinkling it with loads of