$SIG{INT} = 'IGNORE'; # ignore signal and keep on going, but without a connection to your user $SIG{INT} = sub { die "Received SIGINT\n" }; # normal exit with an error