If I press Ctrl+Z or Ctrl+C to stop a perl scriptPresumably you are running on UNIX or Linux? Please confirm. On those platforms CTRL+Z does not usually stop a process but places it suspended in the background. Depending on the shell you are using, type
jobs and you will see a list of them. The shell built-in
fg will resume the background process in the foreground. Read the man pages for your shell.
Both these signals (see above) can be assigned to other keys using stty(1). So if someone has been playfull with your terminal settings they could do almost anything.
You can trap most signals and execute a signal handler subroutine in most languages (even korn shell and bash: see the trap builtin). For Perl see
%SIG in
perlvar.