sub is_opened { return defined fcntl $_[0], F_GETFL, 0; }