http://www.perlmonks.org?node_id=485120

dsb has asked for the wisdom of the Perl Monks concerning the following question:

Question:
I've got a program that builds a FIFO stack. I'm trying to handle any interrupt signals (CTRL-C and such, and possibly orders from the O/S to terminate) by trapping the signal, finishing off the particular element in the stack, and then exiting.

I'm aware of the %SIG hash:

$SIG{INT} = \&handler; sub handler { our $int++; die "signaled"; }
However, I'm not sure how to manage this stack problem and I've no idea where to start.

Suggestions?


dsb
This @ISA my( $cool ) %SIG