my $intr = 0; my $save_handler = $SIG{INT}; $SIG{INT} = sub { $intr++ }; # do something here ... $SIG{INT} = $save_handler || ''; # assign handler back if true, else '' # check value of $intr to see if I was interrupted... #### qwurx [shmem] ~ > perl -wle '$SIG{BLORF} = undef' No such signal: SIGBLORF at -e line 1. #### my $save_handler = $SIG{INT} || '';