Help for this page

Select Code to Download


  1. or download this
    sub GotSignal($) { 
      my $sig = shift; 
    ...
          local $SIG{QUIT} = \&GotSignal('quit');
    
    while (1) { # do stuff }
    
  2. or download this
    
          # Install signal handlers
    ...
          local $SIG{QUIT} = sub { my $sig = shift; print "Got a $sig sign
    +al, exiting\n"; exit(0); };
    
    while (1) { # do stuff }