@reads = $select->can_read() ; for( @reads ) { $data = <$_> ; if( $data == undef && $! != EWOULDBLOCK ) { # socket closed from the other end } }