in reply to Re: Handling sockets in a server
in thread Handling sockets in a server

Not to deviate too much from the questions in this post, so you can close a filehandle and you are able to check a return value from the close? I'm sorry I haven't seen this done. I do check success/failure on closing pipes and the man page link you included talks about pipes returning a failure if one of the system calls failed. So, I believe my statement is acurate about no failure returned on a file handle.

Hopefully, someone can help with the meat of this post.

Thanks,

Shannon Kerr

Replies are listed 'Best First'.
Re^3: Socket
by tbone1 (Monsignor) on Oct 21, 2005 at 13:18 UTC
    Not to deviate too much from the questions in this post, so you can close a filehandle and you are able to check a return value from the close?

    "I'll go further than that, I'll get off at the depot." (*) You can use the syntax:

    close FILEHANDLE or die "Could not close FILEHANDLE: $!\n";
    to tell you what the errno varaible was set to when FILEHANDLE could not be closed.

    --

    (*) - This quote stolen with great embarrassment from Groucho Marx.

    --
    tbone1, YAPS (Yet Another Perl Schlub)
    And remember, if he succeeds, so what.
    - Chick McGee

      Geez, now you sucked me in. Can you demonstrate a block of code that this works with. I've written several tools that tried to check the return on a close filehandle and never have I seen an error. I would like to see a true failure.

      And if someone would like to answer the orginal questions of the post, I would like that too! :)

      Thanks!

      Shannon Kerr
Re^3: Socket
by blazar (Canon) on Oct 21, 2005 at 13:16 UTC
    I have seen someone do, instead. But indeed I've always considered it to be overly paranoid. The point being that a close on a regular filehandle may well fail, but we're confident that it will happen rarely enough no to go mad about it...