in reply to perl SIGnal process

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

Replies are listed 'Best First'.
Re^2: perl SIGnal process
by chinaxing (Acolyte) on Aug 19, 2013 at 07:57 UTC
    yes!

    but i want to known difference between set to   'undef', "" and 'DEFAULT';