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


in reply to When to use sigtrap, when to assign to %SIG?

You use the sigtrap pragma when you need the extra mojo it supplies. In absence of any code, any further answer would be pure speculation.

"Is local $SIG{INT} important?" -- that would depend on how it's used in the code that you haven't shown us. In absence of any code, any further answer would be pure speculation.

UPDATE -- Fixed the link; thanks tanktalus

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: When to use sigtrap, when to assign to %SIG?
by Anonymous Monk on Jan 02, 2012 at 09:37 UTC

    You use the sigtrap pragma when you need the extra mojo it supplies. In absence of any code, any further answer would be pure speculation.

    What mojo? Yes, do speculate

    "Is local $SIG{INT} important?" -- that would depend on how it's used in the code that you haven't shown us. In absence of any code, any further answer would be pure speculation.

    Is using local $SIG... important?

      Is using local $SIG... important?
      Sometimes it is. Usually, it doesn't matter as you want the same handler for the entire run of your program. Most of the time though, it doesn't hurt to have it localized.

      As a rule of thumb, I always localize my sig handlers, unless there's a good reason not to.