Check out Re (tilly) 1: Timeout problem using IO::Socket for more on this.
In reply to Re (tilly) 1: IO::Socket timeout method on Win32 by tilly in thread Forking Issue by Anonymous Monk