[Chapter 7] 7.2.57 sigtrap - Enable Stack Backtrace on Unexpected Signals
Author: Larry Wall, Tom Christiansen & Randal L. Schwartz
Date: 1999-07-02T02:03:59Z

#

| Chapter 7 The Standard Perl Library |

### 7.2.57 sigtrap - Enable Stack Backtrace on Unexpected Signals

    use sigtrap;       # initialize default signal handlers
    use sigtrap LIST;  # LIST example:  qw(BUS SEGV PIPE SYS ABRT TRAP)

The `sigtrap` pragma initializes a signal handler for the signals specified in `LIST`, or (if no list is given) for a set of default signals. The signal handler prints a stack dump of the program and then issues a (non-trapped) ABRT signal.

In the absence of `LIST`, the signal handler is set up to deal with the `ABRT`, `BUS`, `EMT`, `FPE`, `ILL`, `PIPE`, `QUIT`, `SEGV`, `SYS`, `TERM`, and `TRAP` signals.

7.2.56 Shell - Run Shell Commands Transparently Within Perl |  | 7.2.58 Socket - Load the C socket.h Defines and Structure Manipulators