for my $h (@handles) { my $fd = fileno $h; if (defined $fd && $fd >= 0) {