Note that Perl already passes in the name of the signal to the signal handler so simply: $SIG{QUIT}= \&GotSignal; would produce the message Got a QUIT signal, exiting so if the case of the name bothers you, another alternative would be:
- tye (but my friends call me "Tye")sub GotSignal { my $sig= ucfirst lc shift; print "Got a $sig signal, exiting\n"; exit(0); }
In reply to (tye)Re: Strange SIGNAL HANDLER behavior...
by tye
in thread Strange SIGNAL HANDLER behavior...
by Clownburner
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |