You might find it much easier to use the IO::Socket module to do socket programming.
Autark.
In reply to RE: learn sth. by autark in thread learn sth. by Delfer