#!/usr/bin/perl use strict; use warnings; $SIG{INT} = 'handleit'; while (1) { print "still here...\n"; sleep 30; } sub handleit { print "I caught it."; exit(1); }