The versions of perl I have do not contain those modules. That's the trick. I know there are tons of libraries out there that do this but the problem is that my toolset I have to work with is very limited.
Comment on Re^2: compare images with perl 5.6 or 5.8
If you can't use modules, you should look at ikegami's reply in Fast way to compare two picture-files. You will need to somehow dump the pixels manually and compare them. It will be slow in Perl.