iselect solves a similar problem in a general way but may not be useful to you directly.
In reply to Re: Multiple STDIN sources by bsb in thread Multiple STDIN sources by perlfan