Re: Howto catch a signal and continue afterwards

C.DeRykus wrote:

On Feb 15, 11:59 am, (Matthias Meyer) wrote:
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" );

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
are often generated.

Any END {} blocks still execute though.

Charles DeRykus

SIGIO work.
Don't Panic