If you read "perldoc -f select", it allows you to put a timeout on the select statement, maybe that is what you are after?
Or maybe you want to regex the output, and if it is empty, leave the loop.
I'm not really a human, but I play one on earth.
flash japh