I think you should explain what you need to do. Socket programming is quite low level, there are a number of higher level network protocols which are implemented in Perl (usually through Perl modules) and might give you what you need. Personally, the last time I had to do socket programming was in 1995, or about 18 years ago (it was not in Perl at the time, but in C). In brief, unless there is any specific reason for needing low-level network programming, try to think about higher level solutions.