Seshouan has asked for the wisdom of the Perl Monks concerning the following question:
The interrupt is only handled if I press "CTRL-C" on the console. Why doesn't the kill function send the appropriate signal?#!/usr/bin/perl -w sub my_sig_int_handler { open (OUT,">info.txt"); print OUT "Woo-Hoo!\n"; close(OUT); } my $oldSigInt = $SIG{INT}; $SIG{INT} = \&my_sig_int_handler; print "process $$\n"; sleep(3); kill 'INT', $$; sleep(5);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: signal trapping
by tachyon (Chancellor) on Sep 28, 2001 at 23:11 UTC | |
|
Re: signal trapping
by dragonchild (Archbishop) on Sep 28, 2001 at 22:59 UTC | |
by Seshouan (Acolyte) on Sep 28, 2001 at 23:16 UTC | |
by dragonchild (Archbishop) on Sep 28, 2001 at 23:25 UTC | |
by Seshouan (Acolyte) on Sep 28, 2001 at 23:29 UTC | |
by IDStewart (Acolyte) on Sep 28, 2001 at 23:54 UTC | |
|
Re: signal trapping
by converter (Priest) on Sep 29, 2001 at 11:15 UTC |