in reply to Socket Problem

What does the program spit out when you run it? All I see is the code twice..

The reason that I say this is $! should translate to an actual message of what the error is.

Also, Look at properly formatting your questions with the appropriate code tags and such and you will get a much faster response.