$SIG{"INT"} = "interrupt"; while(1) { } sub interrupt { print "You can't kill me!"; $SIG{"INT"} = "interrupt"; }