in reply to Perl Signals
there is no need for "$SIG{"INT"} = "interrupt";" within interrupt() subroutine. I would take that out.
the signal name should be first arg when interrupt() is called. So you can set up one interrupt routine that handles multiple signals (don't strictly need one handler per signal).sub interrupt { my $sig_name = shift; print "You can't kill me! $sig_name caught"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl Signals
by afoken (Chancellor) on Nov 14, 2011 at 10:10 UTC | |
by Marshall (Canon) on Nov 14, 2011 at 22:23 UTC | |
by afoken (Chancellor) on Nov 17, 2011 at 16:51 UTC | |
by ikegami (Patriarch) on Nov 14, 2011 at 19:30 UTC |
In Section
Seekers of Perl Wisdom