Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Track open file handles

by mr_mischief (Monsignor)
on Apr 05, 2017 at 17:45 UTC ( #1187165=note: print w/replies, xml ) Need Help??

in reply to Track open file handles

I would see great value in the solution if I saw value in creating the problem it solves. This seems useful perhaps as an aid in the toolkit for refactoring or debugging existing bad code. When writing new code I think it'd be easier, more productive, and less invasive to just keep track of the resources a program needs to use within the program in the first place.

Replies are listed 'Best First'.
Re^2: Track open file handles
by shmem (Chancellor) on Apr 05, 2017 at 18:10 UTC

    Of course yes! Normally there's no need to keep track on file handles, if you use them properly. This module is meant as a tool to track down bugs, and to find out the bugs aren't where you think they are -because bugs are always elsewhere. So maybe it should live in the Devel namespace, e.g. Devel::FileHandle::Track or so.

    ...if I saw value in creating the problem it solves.

    The only value in creating problems is to learn how not to create them in the first place.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

      It could theoretically come in handy as part of a test suite for a distribution that must track handles (because it maintains several at any given time), to ensure none accidentally leak during a run.

      My File::Edit::Portable came to mind immediately. Although there's thorough coverage already, it's one place something like this would be quite useful.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2022-09-30 06:12 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (125 votes). Check out past polls.