#!/usr/bin/perl -w use strict; $SIG{INT} = 'CtrlC'; for (1..10) { print "$_\n"; sleep(1); } sub CtrlC { print "CTRL-C seen and ignored!\n"; } __END__ Example run:... I am just hitting CTRL-C at various times... C:\TEMP>perl ctrlc.pl 1 2 3 CTRL-C seen and ignored! 4 CTRL-C seen and ignored! 5 6 7 CTRL-C seen and ignored! 8 9 10