, if you're planning on the possibility of scaling this to be more than just for your own personal use, (and even then) why not just write a plugin for tik
(which has built-in support for perl)? Unless this is intended to be a proof of concept / educational project it seems like overkill to reinvent the wheel when there are so many other chat clients out there.
While we're on the topic, mentioning that AOL has opened
their AIM protocol may be worth knowing.
And before people reply to this post, yes, I do realize that I've only mentioned AOL compatible clients here. Others have provided links to alternate systems, and I don't see a need to duplicate that here.