http://www.perlmonks.org?node_id=700926


in reply to Re: print on reboot or process shutdown
in thread print on reboot or process shutdown

Ty. I read the doc and was able to fix it. This is the code that I place in the beginning of my script.
END { open(THEND,">ABORTED"); close(THEND); }
But the END block is also executed when the script finishes. And it should only be executed on reboot or process kill.