in reply to What module should I use?

For the TCPIP stuff, I recommend looking at O'Reilly's Perl Cookbook for ideas. The Sockets chapter has some really good examples on writing TCPIP servers and clients.

Chris