Kill and Signals
From: Isidro Vila Verde (jvv_at_serprest.pt)
Date: 11/16/03
- Next message: rk: "Help on cgi/perl programs to port, view and edit reports"
- Previous message: Tom McCarthy: "Hexadecimal date format"
- Next in thread: Roy Johnson: "Re: Kill and Signals"
- Reply: Roy Johnson: "Re: Kill and Signals"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 16 Nov 2003 06:34:39 -0800
Greetings,
I need to handle signals to close some excel applications that my
script open, when the script is killed by another process.
My script is a little bit complex, but I wrote just two very small
scripts to test the kill and signal.
The scripts signal.pl is this one:
map {$SIG{$_} = sub {my $n = shift; print "n=$n\n"}} keys %SIG;
#just in case
$SIG{INT} = sub {my $n = shift; print "n=$n\n"};
print "pid = $$\n";
sleep 1 while(1)
And the second one (kill.pl) is just the following line:
kill ($ARGV[0] => $ARGV[1]);
What I call the second like this:
>perl kill.pl INT pid_returned_from_first_script
I expected the signal to be handled by fisrt script, but no matter
what signal I sent, the first script never receives the signal. It
just was killed without any signal handling.
Does anyone know what I am doing wrong here?
Isidro
- Next message: rk: "Help on cgi/perl programs to port, view and edit reports"
- Previous message: Tom McCarthy: "Hexadecimal date format"
- Next in thread: Roy Johnson: "Re: Kill and Signals"
- Reply: Roy Johnson: "Re: Kill and Signals"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|