slloyd has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to close an socket handle if all you have is its fileno? I can open a socket handle as follows but does that actually close it if it was already open?
if(open( $Client, "+<&=$fno" )){ close($Client); }

-------------------------------
by me
http://www.basgetti.com
http://www.kidlins.com

Replies are listed 'Best First'.
Re: Closing an open socket by its fileno
by duff (Parson) on Feb 26, 2006 at 05:03 UTC

    Yep, closing that filehandle will cause the descriptor associated with it to close.

Re: Closing an open socket by its fileno
by Fletch (Bishop) on Feb 26, 2006 at 14:04 UTC

    I believe POSIX::close should take a file descriptor.