local $SIG{TERM} = sub { print STDERR "Got SIG{TERM}! Abort execution? (y/n)"; my $c = getc; chomp $c; exit 0 if lc($c) eq 'y'; };