in reply to trouble with custom signal handlers
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: trouble with custom signal handlers
by BrowserUk (Patriarch) on Apr 17, 2016 at 12:57 UTC | |
by casaschi (Novice) on Apr 17, 2016 at 14:42 UTC | |
by BrowserUk (Patriarch) on Apr 17, 2016 at 15:11 UTC | |
by Marshall (Canon) on Apr 17, 2016 at 15:55 UTC | |
by BrowserUk (Patriarch) on Apr 17, 2016 at 17:40 UTC | |
|