Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Why shouldn't I use it?

You should, I misread your answer actually (I thought you said the hash would prevent the deletion of the handles), I agree with you that this feature is useful.

But! returning a weakened reference from get_fds is a good idea. Thank you.

Adding it at the last moment, or storing it as a member as soon as the handle is opened (even if that means having two weak reference to the same handle in nearly the same place) is pretty much the same thing. There's a difference when you return $fd => { fd => $fd, %{$fd{$_}} } rather than id_2obj($_) => $fd{$_} though, in the first case, if the user keeps the hashref, it will always have the values it had when acquired, while in the latter, the "close" and "closetime" value will appear when the handle is closed. I like the first version better, because you have to call get_fds to get up-to-date information.


In reply to Re^5: Track open file handles by Eily
in thread Track open file handles by shmem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2022-07-01 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (99 votes). Check out past polls.

    Notices?