Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: How do I make the garbage collector throw an exception when it fails to auto-close a filehandle?

by gaal (Parson)
on Jan 14, 2007 at 05:52 UTC ( #594610=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How do I make the garbage collector throw an exception when it fails to auto-close a filehandle?
in thread How do I make the garbage collector throw an exception when it fails to auto-close a filehandle?

I don't like the extra scope and the fact that it's local at best. If you do put it on CPAN, make a note to say it isn't thread safe.


Comment on Re^3: How do I make the garbage collector throw an exception when it fails to auto-close a filehandle?
Download Code
Re^4: How do I make the garbage collector throw an exception when it fails to auto-close a filehandle?
by Aristotle (Chancellor) on Jan 14, 2007 at 06:19 UTC

    Id want it global. Otherwise Id subclass IO::Handle and instantiate that class instead; that works just as well and wont conflict with anything else.

    How does overriding DESTROY break thread safety?

    Makeshifts last the longest.

      If you attempted to limit the effect of the change to that one function (and those it calls) using local *IO::Handle::DESTROY = sub { ... };, your code wouldn't be thread-safe.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://594610]
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: (10)
As of 2014-07-28 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (209 votes), past polls