in reply to convert letters into a number
Sounds like a variant of a very simple crypt function. I would look at cpan into the Crypt:: domain and see if there is such a module. If you find one: Might be helpful to look at the source and change the algorithm according to your needs.