473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Kill and Signals

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
Jul 19 '05 #1
1 6079
This newsgroup is defunct. You will reach more people on
comp.lang.perl.misc.

jv*@serprest.pt (Isidro Vila Verde) wrote in message news:<2c**************************@posting.google. com>...
I need to handle signals to close some excel applications that my
script open, when the script is killed by another process.


Presumably, you're using ActivePerl.

http://aspn.activestate.com/ASPN/doc...ignal_Handling
Signals are unsupported by the Win32 API. The C Runtime provides crude
support for signals, but there are serious caveats, such as inability
to die() or exit() from a signal handler. Perl itself does not
guarantee that signal handlers will not interrupt critical operations
such as memory allocation, which means signal invocation may throw
perl internals into disarray. For these reasons, signals are
unsupported at this time.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jerry Sievers | last post by:
Greetings Pythonists; I have limited experience with threaded apps and plenty with old style forked heavyweight multi-processing apps. Using Python 2.3.3 on a Redhat 7.x machine. Wondering...
4
by: Gabriele Bartolini | last post by:
Hi, I am writing an application in C++ on Linux, using threads (this is my first experience with pthreads). The application itself is fine, it is just that I wanted to handle asynchronous...
1
by: Leo Kirch | last post by:
Hello XSLT gurus, i've got a rather difficult problem. Some explanations first. theres a signal oriented xml-file - the graphical represantation looks like: | startsignal (signal00) \...
4
by: maxmagna | last post by:
Hello, I am looking for material that describes how *precisely* UNIX-based signals interact with the normal C++ execution flow of control and guidelines on how to treat signals in an...
0
by: Arnaud Debaene | last post by:
Hello all. I've got a bunch of existing, non managed, C++ DLLs that export types with, among other things, public events implemented using the boost::signals library. Now, I need to have...
1
by: psawant | last post by:
Hi! I want to handle "kill","ctrl-c" sigkill,sigint signals in vb.net. I have done it once in C. It was a cake wake.Could not a figure out how to do the same in vb.net. Thanks all.. In...
10
by: I. Myself | last post by:
Suppose we spawn a child process with Popen. I'm thinking of an executable file, like a compiled C program. Suppose it is supposed to run for one minute, but it just keeps going and going. Does...
5
by: Miguel | last post by:
What signal have I to take into account in order to capture the 'kill -9 ' call from command shell? the code is something like this void manager(int i){ printf("%d\n",i); system("chmod 644...
11
by: vippstar | last post by:
What is the purpose of signals and why do they exist in C? thanks in advance
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.