Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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://594612]=note: print w/replies, xml ) Need Help??


in reply to Re^3: 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’d want it global. Otherwise I’d subclass IO::Handle and instantiate that class instead; that works just as well and won’t conflict with anything else.

How does overriding DESTROY break thread safety?

Makeshifts last the longest.

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

Replies are listed 'Best First'.
Re^5: How do I make the garbage collector throw an exception when it fails to auto-close a filehandle?
by ikegami (Patriarch) on Jan 14, 2007 at 06:22 UTC

    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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://594612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found