Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 ( #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?

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.

  • 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 (Pope) 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
Node Status?
node history
Node Type: note [id://594612]
help
Chatterbox?
[1nickt]: Wow, sometimes "Perl programming" hardly involves Perl! I just spent a couple of days implementing some features in the CPAN Testers API and it was 90% hand-editing JSON Swagger config and test data structs, and writing doc. Maybe that's just the sign of
[Discipulus]: rethatching? a real, old cottage?
[1nickt]: ... a well-crafted project that's easy to extend.
[1nickt]: Discipulus I believe virtualsue *is* that fortunate. @10:42Z yesterday "my view this morning is of a chap stuffing straw in my roof" ...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2017-11-21 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (297 votes). Check out past polls.

    Notices?