Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: How to close all open file descriptors after a fork?

by bart (Canon)
on Jul 19, 2005 at 14:38 UTC ( #476127=note: print w/ replies, xml ) Need Help??


in reply to Re: How to close all open file descriptors after a fork?
in thread How to close all open file descriptors after a fork?

I prefer "lexical FHs" because they will automatically closed on scope exit
No they won't. Your array will still hold a copy and they all will be kept open.

These file handles are references, are they not? You could try weaken these references in the array, and they'll automatically go away as normal — leaving just an undef in place.


Comment on Re^2: How to close all open file descriptors after a fork?
Re^3: How to close all open file descriptors after a fork?
by blazar (Canon) on Jul 19, 2005 at 14:50 UTC
    No they won't. Your array will still hold a copy and they all will be kept open.
    I meant: "in a general situation". In this particular one I suggested to explicitly close the entries kept in the array. I also included a footnote mentioning the ref thing.
    These file handles are references, are they not? You could try weaken these references in the array, and they'll automatically go away as normal leaving just an undef in place.
    This is a very interesting suggestion, although I have no experience myself weakening references. I won't try because this is not my problem, but I will keep it in mind for when it may be of some use for me...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://476127]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-07-25 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (169 votes), past polls