in reply to Re^4: waking from select, or IO::Pipe in same process?
in thread waking from select, or IO::Pipe in same process?
$ perl -E' $SIG{INT} = sub { if ($i++) { say "You were sure."; exit(1); } else { say "Are you sure?"; } }; for (;;) { say "Waiting..."; if (select(undef, undef, undef, undef) < 0) { if ($!{EINTR}) { say "Interrupted"; } else { die $!; } } else { say "select returned without an error???"; } } ' Waiting... ^CAre you sure? Interrupted Waiting... ^CYou were sure.
|
|---|