Re: Howto catch a signal and continue afterwards
- From: matthias.meyer@xxxxxx (Matthias Meyer)
- Date: Wed, 17 Feb 2010 22:41:26 +0100
C.DeRykus wrote:
On Feb 15, 11:59 am, matthias.me...@xxxxxx (Matthias Meyer) wrote:SIGIO work.
Hi group,
I try to catch a signal, write out some statistics about my running
perl program and continue afterwards with the program.
use strict;
no utf8;
use MyProgram::Lib;
use Encode;
use Socket;
use File::Path;
use File::Find;
use Getopt::Std;
die("MyProgram::Lib->new failed\n") if ( !(my $init =
MyProgram::Lib->init) ); $SIG{ILL} = \&write_status;
:
sub write_status
{
my $sigName = shift;
print( STDERR "Signal ILL catched" );
return;}
Within bash I send the signal with "kill -4 <procID>"
Unfortunately my program die after catching the signal.
Without the print it dies too.
Also within debugger (perl -d:ptkdb) it dies after the return statement.
Is it possible to interrupt a perl program and continue afterwards?
Most signals can be caught and programs can continue. However SIGILL
by default causes program termination and can't be ignored. Core
dumps
are often generated.
Any END {} blocks still execute though.
--
Charles DeRykus
Thanks
Matthias
--
Don't Panic
.
- References:
- Howto catch a signal and continue afterwards
- From: Matthias Meyer
- Re: Howto catch a signal and continue afterwards
- From: "C.DeRykus"
- Howto catch a signal and continue afterwards
- Prev by Date: Re: Problem printing a string value
- Next by Date: initialize and modify a string at the same time
- Previous by thread: Re: Howto catch a signal and continue afterwards
- Next by thread: PayPal API
- Index(es):
Relevant Pages
|