Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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?
Replies are listed 'Best First'.
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 making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2015-07-30 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls