in reply to Simple Msg/Response Socket Setup

you might use stem for this.

or take a look in Linconln Stein's "Network Programming with Perl"