#!/usr/bin/perl use strict; use warnings; sub catch_zap { my $signame = shift; die "Somebody sent me a SIG$signame"; } $SIG{INT} = \&catch_zap; # best strategy $SIG{TSTP} = \&catch_zap; # best strategy my $t = time; $t += 30; while ( time < $t ) { print scalar localtime, qq{\n}; sleep 1; }