in reply to Re: How aggressively does Perl clean up when you exit()?
in thread How aggressively does Perl clean up when you exit()?

I doubt there will be lingering socket connections since those are treated as FileHandles and all FileHandles should be wiped. Shared memory can be nuked by putting in this catching the INT signal like this:

$SIG{INT} = sub { IPC::Shareable->clean_up_all ; exit 0;} ;

You might want to catch other signals as well for this, however this catches everything I have ever run into except a perl core dump.

Update: Hmmm, crazyinsomniac has said that you can't/shouldn't exit when catching INT. I will take his word on it, as he has been perling longer than I I'm sure. However this has been working for me in an existing implementation, maybey I'm bound for a crash!! I'll have to debug it futher.

"Nothing is sure but death and taxes" I say combine the two and its death to all taxes!

Replies are listed 'Best First'.
Re: Re: Re: How aggressively does Perl clean up when you exit()?
by belg4mit (Prior) on Nov 14, 2001 at 23:41 UTC
    Try a different signal or better yet setup an END{} See perlfunc:exit.