in reply to Closing an open socket by its fileno
I believe POSIX::close should take a file descriptor.