in reply to How can I kill subprocesses when the main script dies?

Maybe an END block:
END { kill 'INT' => keys %children; }
If you keep the PIDs for your kids in %children, that'll do it. For example, the following script dies, but still prints the ending notice:
#!/usr/bin/perl -w use strict; BEGIN { print "This is at the start\n"; } die; print "This is in the middle.\n"; exit; print "This should never print.\n"; END { print "This is in the end.\n"; }