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