I am fond of pidgin. And I know the internals. And I have done things with the libpurple. Actually I am writing an im client too.
OK , there is a perl binding of the libpurple. The functions there are pFlere
This should be simple to implement, but before say my last word I want to see detailed job description.
Please, send it to my email [removed] and I'm sure that we'll find how we can interact in best manner.