in reply to Re: Perl action on cancellation
in thread Perl action on cancellation

Note that doing anything complicated (such as calling "print") from a signal handler can lead to a memory fault and core dump if you're using a perl version < 5.8.

Another way to install signal handlers is the sigtrap pragma:
use sigtrap(die INT) END { ##do whatever it is you need to do }
This will trap Ctrl-C on Unix systems (dunno about Windows) and allow you to put the appropriate action into the END block.