I believe you are refering to a CAPTCHA. The previous wiki links to various Perl resources, and there are a few hits on Cpan you should take a look at. The entire point of this kind of security image is to make it hard for programs to 'read' the text content of the image.