#!c:\perl\bin\perl.exe #Assign signal handlers $SIG{'NUM12'} = 'handler'; $SIG{'CHLD'} = 'handler'; print "List current SIG handlers...\n"; while ( my ($key, $value) = each(%SIG) ) { print "$key => $value\n" if ($value ne ''); } print "My PID is $$. I go sleep and wait for signals and ...\n"; while(1) { sleep; } sub handler{ local ($sig) = @_; # Problem: This line never printed. print "I am doing something for SIG $sig....\n"; }