Why did IO::Select brings GLOB(0x880fe78) up as ready for reading at all, when it was opened as the write (input) filehandle?
select actually signals when a file handle needs to be serviced. In addition to "ready to read" for can_read, that includes EOF and error conditions.
In this case, the OS is ready to communicate to you that you can't read from a write-only handle.
In general, you want two select objects, one for readers and one for writers. If you want to wait for either, you'd use select instead of can_*.
my ($r, $w) = IO::Select::select($readers_sel, $writers_sel, undef);
I don't understand why the program terminates after writing the answer to the first question.
You only call can_read once. You appear to be missing a loop.
In reply to Re: Weirdness with IO::Select and IPC::Open3
by ikegami
in thread Weirdness with IO::Select and IPC::Open3
by rastoboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |