$SIG{TERM}=sub { #do something here };