AFAIK, best OCR available under open source licenses is Tesseract which might fit your bill if you wrap if with some perl code (it's a simple command-line utility).
Update: fixed URI to point to googlecode where current project page is. There is also great documentation site if you want to know more.