I have a test script like this:
package Test;
sub new { bless {} }
sub DESTROY { print "in DESTROY\n" }
package main;
my $t = new Test;
sleep 10;
The destructor is called after sleep
returns (and before the program terminates). But it's not called if the script is terminated with Ctrl-C. Is it possible to have the destructor called in this case also?