sub cleanup { $SIG{HUP}='IGNORE'; kill (HUP,-$$); exit -1; } $SIG{HUP}='cleanup'; $SIG{TERM}='cleanup'; $SIG{QUIT}='cleanup';