Catch and Handle Signals in Perl

“Signals are types of messages sent by an operating system to a process such as a Perl program. Signals provide a method for communicating with a process, for example when running a command line program pressing control-c will send the interrupt signal (‘SIGINT’) to the program by default terminating it. Signals are often unexpected and if not handled can leave your Perl program or data in an unfinished state. This article describes some useful Perl programming tools for gracefully handling signals…”
http://perltricks.com/article/37/2013/8/18/Catch-and-Handle-Signals-in-Perl

use sigtrap qw/die normal-signals/;
http://perltricks.com/article/38/2013/8/27/Perl-destructor-not-being-called–Here-s-why