in reply to Reading image file

Since your question is vague it is open to interpretation. To me it sounds as though you want to extract text from an image - which is OCR. For Perl OCR modules search CPAN: OCR

Reading the contents of the image file would be
perl -pe "" imagefilename
which, I am sure, is no help to you at all.

Since OCR is also always also a security related topic you may want to provide a brief motivation for your question. This way everybody will be happy to assist without fearing to support a malicious forum spammer. So: Please tell us more and help us help you.

Cheers - Pat