in reply to Re^4: Memory consumption of forks on exit
in thread Memory consumption of forks on exit

I seems I have not explained clearly my workaround. Let my try again with some sample code:
END { # sub END { OOPS!!! do_something(); POSIX::_exit(0); } do_this(); do_that(); exit(0);

update: sub in front of END removed!

Replies are listed 'Best First'.
Re^6: Memory consumption of forks on exit
by egga (Monk) on May 19, 2011 at 12:04 UTC

    I'm sorry, but that doesn't work out on my machine. The peak is still there

      An END block is not a sub. Take sub off. Just END{...}. The END block will execute before program really exits thereby calling the type of exit you want instead of the normal one as previous monk pointed out.
        An END block is not a sub. Take sub off.

        The parser allows sub <SPECIALNAME>; it's not an error.

        >perl -E"sub BEGIN { say 'BANG!'; } sub END { say '2012'; }" BANG! 2012

        Peaks:

        for (1 .. 10) { unless (fork) { exit(); } } END { POSIX::_exit(0); }