G'day chinaxing,
For further documentation, take a look at perlipc - Signals.
For setting defaults, why not capture the starting values and then reapply the defaults if you need to:
$ perl -Mstrict -Mwarnings -E ' my %default_signal_for = %SIG; say "*** Starting values ***"; say "SIG{USR1}: ", $SIG{USR1} // "<undef>"; say "DEF{USR1}: ", $default_signal_for{USR1} // "<undef>"; $SIG{USR1} = sub { 1 }; say "*** After setting USR1 ***"; say "SIG{USR1}: ", $SIG{USR1} // "<undef>"; say "DEF{USR1}: ", $default_signal_for{USR1} // "<undef>"; $SIG{USR1} = $default_signal_for{USR1}; say "*** Back to default values ***"; say "SIG{USR1}: ", $SIG{USR1} // "<undef>"; say "DEF{USR1}: ", $default_signal_for{USR1} // "<undef>"; ' *** Starting values *** SIG{USR1}: <undef> DEF{USR1}: <undef> *** After setting USR1 *** SIG{USR1}: CODE(0x7fa4008401b0) DEF{USR1}: <undef> *** Back to default values *** SIG{USR1}: <undef> DEF{USR1}: <undef>
-- Ken
In reply to Re: perl SIGnal process
by kcott
in thread perl SIGnal process
by chinaxing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |