I have come up with a final solution.
I decided that the fastest way to solve this one is
to not use perl. This is the very first problem I've
encountered since I started with perl that is easier
to code in C. ;) Usually it's the other way around.
Well, here's my final solution:
MDiffMDiff-0.8.tar.gz