in reply to Re^4: How can I test TCP socket status in Perl?
in thread How can I test TCP socket status in Perl?

return (0) unless ($sock->connected()); return (0) unless (getpeername($sock));

Perhaps you should go find the source code of the connected() method.

sub connected { @_ == 1 or croak 'usage: $sock->connected()'; my($sock) = @_; getpeername($sock); }

- tye