in reply to Determining socket status

If the socket is dead, then I/O will fail. Check the response from your I/O. (Yes, this is one of the few times when "print blah blah or whatever" actually makes sense.)

If you want to poll without I/O, then consider a simple query, like getpeeraddr(), which will fail if the socket isn't alive.

-- Randal L. Schwartz, Perl hacker