in reply to kill command in perl?

Take a look at signal handlers and the kill function.