Now I just need to dig documentation of the Safe module to find out what is going on with http://perldoc.perl.org/Safe.htmluse warnings; use strict; use Safe; our $mySafe = new Safe; sub handleSigs { my ($signalReceived) = @_; my $exitVal = 0; warn("warning: received $signalReceived signal"); if ($signalReceived eq "INT") { $exitVal = 1; } elsif ($signalReceived eq "USR1") { $exitVal = 2; } elsif ($signalReceived eq "USR2") { $exitVal = 3; } exit($exitVal); } $SIG{USR1}=\&handleSigs; $SIG{USR2}=\&handleSigs; $mySafe->reval("10 + 20"); print "My PID is $$\n"; sleep(100); print "Exiting\n";
In reply to Re: trouble with custom signal handlers
by casaschi
in thread trouble with custom signal handlers
by casaschi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |