use Fcntl; my $flags = fcntl $in, F_GETFD, 0 or die "fcntl F_GETFD: $!"; fcntl $in, F_SETFD, $flags & ~FD_CLOEXEC or die "fcntl F_SETFD: $!";