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

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.
  • Comment on Re^7: Memory consumption of forks on exit

Replies are listed 'Best First'.
Re^8: Memory consumption of forks on exit
by chromatic (Archbishop) on May 19, 2011 at 16:47 UTC
    An END block is not a sub. Take sub off.

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

Re^8: Memory consumption of forks on exit
by ikegami (Patriarch) on May 19, 2011 at 21:28 UTC
    >perl -E"sub BEGIN { say 'BANG!'; } sub END { say '2012'; }" BANG! 2012
Re^8: Memory consumption of forks on exit
by egga (Monk) on May 19, 2011 at 13:49 UTC

    Peaks:

    for (1 .. 10) { unless (fork) { exit(); } } END { POSIX::_exit(0); }
      Well at least you are executing the END block now. A print in the END block would show that it gets called 11 times. did you try the other idea of using exec "/bin/true" in the END block?

        It still peaks. Guess I will have to use the dancing approach.