if (!$rv) { if (defined($rv)) { # eof state, remove from io::select; } else { # error state, remove from io::select; } } else { # process $buf; }