I am new to perl and am working on a short little script that needs to catch a SIGINT signal.
I am working on a small embedded linux system with busybox.
Here is a brief snippet of how I setup my signal handler:
$SIG{INT} = \&intHandler;
+
...
+
sub intHandler {
...
}
When I run the script I get the following message (but it continues to run the rest of the script:
$ ./wdminterface.pl
No such signal: SIGINT at ./wdminterface.pl line 40 (#1)
(W signal) You specified a signal name as a subscript to %SIG that
+ was not recognized.
Say kill -l in your shell to see the valid signal names on your sy
+stem.
$
Running kill -l confirms that I have that signal:
$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR
+2
13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGSTK
+FLT
17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTS
+TP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCP
+U
25) SIGXFSZ 26) SIGVTALRM 27) SIGPROF 28) SIGWIN
+CH
29) SIGIO 30) SIGPWR 31) SIGSYS
$
I'm I missing something simple here? I can't figure out why it won't find the signal. Is this a problem with my perl code, perl setup or linux setup?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.