In a bit more detail than above:
The signal comes in, interrupting select inside of can_read. Between that op and the next, the signal handler is called. It calls waitpid until it returns an error, setting $! to ECHLD. The signal handler returns, and nothing changes $! between there and when you check it.
By the way, there was talk of having certain variables automatically localised by the signal handler, including $!. I don't know if that's already in 5.12 or 5.14.
In reply to Re: Inexplicable ECHILD
by ikegami
in thread Inexplicable ECHILD
by williams
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |