in reply to fork & END

You can try something like this:
use POSIX qw(_exit); if (fork) { # parent } else { # child. # do stuff _exit(0); # "simple exit", does not run END } END { # do stuff; only run on parent }