in reply to win32, ctrl-c, sleep, and signals

See ActiveState's ActivePerl FAQ - Implementation Quirks documentation, "Why doesn't signal handling work on Windows?". Signals are a UNIX thing, and are only implemented in the C runtime library on Windows enough to conform to C89 standards. For example, on Linux sleep will raise a SIGALRM when it times out, but on Windows SIGALRM is not supported (alarm is one of the functions listed as not implemented by ActiveState).
Windows uses a different architecture for console handling compared to UNIX terminal handling. In Win32 a CTRL+C (or Break) is controlled using SetConsoleCtrlHandler, not signals in the UNIX sense (even though the MSDN talks about raising a signal).

Replies are listed 'Best First'.
Re^2: win32, ctrl-c, sleep, and signals
by Anonymous Monk on Jun 01, 2006 at 16:45 UTC
    alarm() is implemented in perl5.8+ on win32. just try it:
    perl -e "eval {local $SIG{ALRM} = sub { die qq!alarm\n! };alarm 1;slee +p 2;alarm 0;};die $@ || 'nothing'"