in reply to Array Woes

The problem is that 'and'. If you failed to create the socket, undef returned, and there is no need for perl to access whatever after that 'and'. So $connect is not set to what you want.