in reply to Re^8: Exiting a script with an 'infinitely looping' thread
in thread Exiting a script with an 'infinitely looping' thread
That it doesn't work in Windows has nothing to do with safe signals,...
On no?
Try this (on a Windows system and perl 5.8.x using a cmd.exe exe console and a standard 101-key ps2-compatible keyboard configured for UK, on a Monday in November; shortly after 5.00 pm with a tail wind and a little good luck...)
C:\test>set PERL_SIGNALS=safe C:\test>perl -wle"$SIG{INT}=sub{exit}; sleep 100" Terminating on signal SIGBREAK(21) C:\test>set PERL_SIGNALS=unsafe C:\test>perl -wle"$SIG{INT}=sub{exit}; sleep 100"
In the first case, ^C has no effect, hence the need for ^break (SIGBREAK).
However, the second example (with set PERL_SIGNALS=unsafe) it responds to ^C immediately.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Exiting a script with an 'infinitely looping' thread
by ikegami (Patriarch) on Nov 24, 2008 at 18:01 UTC | |
by BrowserUk (Patriarch) on Nov 24, 2008 at 19:11 UTC | |
by ikegami (Patriarch) on Nov 24, 2008 at 22:38 UTC |