#!/usr/bin/perl -w use strict; $SIG{INT} = \&handler; while (1) { sleep(1); } sub handler { print "ctl-c entered\n"; exit(0); }