itub's solution is probably what you're looking for not to be brutal, but I'd object that you're probably looking the problem from the wrong point of view.

Doing a little shift to a similar field for the moment, it's clear that not all libraries are good to be used in a multithreaded world. This is because many times the library assumes to be the only owner of some resources, and the multithreaded environment does not guarantee this any more. The bottom line is that you have to adapt the library to work in the new environment, avoiding dirty tricks in the environment itself.

This case seems pretty similar. What if the module you're using is already fork-robust, but still needs to execute its END block to work properly in the quitting father? Skipping the END block would simply break it, and this doesn't seem too fair. Again, I think that the bottom line is that you have to make sure that the module is fork-robust, and not try to put dangerous work-arounds outside of them. The upgrading suggestion from xdg points in this direction IMHO (... 0.15 improved forking support...).

Just my 2c as usual,

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

In reply to Re: fork & END by polettix
in thread fork & END by tlm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.