in reply to programming question

Unix Network Programming will help you every time you write a network program for the rest of your life. Even though it is written for C, the principles are applicable in Perl -- and a lot easier to use, too.

I warn, however, that it is a very dense text, and will need to be read and tinkered with extensively before the massive dose of information fully sets in.

There is a more recent version of the book which is split into three volumes; I haven't read it, but if that's what is available, then go for Volume 1 to start.