16.13. Listing Available Signals16.13.2. SolutionIf your shell has a built-in kill -l command, use it: % kill -l HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH POLL PWR Or using just Perl, print the keys in %SIG if you have release 5.004 or later:
Before Version 5.004, you had to use the Config module:
16.13.3. DiscussionIf your version of Perl is before 5.004, you have to use signame and signo in Config to find the list of available signals, since keys %SIG wasn't implemented then. The following code retrieves by name and number the available signals from Perl's standard Config.pm module. Use @signame indexed by number to get the signal name, and %signo indexed by name to get the signal number.
16.13.4. See AlsoThe documentation for the standard Config module, also in Chapter 32 of Programming Perl; the "Signals" sections in Chapter 16 of Programming Perl and in perlipc(1)
Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|