sub timedO {
    print "we timed out\n";
    exit(0);
}

sub cc {
    print "interrupt seen\n";
    exit(0);
}

#we have created subroutines that will handle the two signals that
# we expect

$SIG{ALRM} = 'timedO'; #set references to handlers for the signals
$SIG{INT} = 'cc';	    # that we wish to trap.  We just pass the names

alarm(3);	#set an alarm to send a signal in 3 seconds
#alarm is a function of the OS, and Perl, that queues a signal 
# after the set number of seconds

<STDIN>;	# wait for keyboard input
print "we did get some input\n";
