#!/usr/local/bin/perl

sub handler{
   local ($signal) = @_;

   print "The $signal was caught  \n";
   $SIG{'USR1'} = 'handler';
}

# the signal array is an associative array %SIG

print "The process id is $$\n";
# ignore the HUP signal
$SIG{'HUP'} = 'IGNORE';

# set the action for  SIGBUS to default.
$SIG{'BUS'} = 'DEFAULT';

# set usr1 handler to be handler.

$SIG{'USR1'} = 'handler';

while (1) {
   $count++;
}
