When you reopen INPUT (the '>&' symbols are an error) the original is closed. You need to open two distinct filehandles and use four argument select ('perldoc -f select') to read them simultaneously.
It is educational to roll your own select loop, but IO::Select is the way to get it done. 'man IO::Select' will tell you if you already have it, and how to use it.
After Compline,
Zaxo
In reply to Re: Merging two pipes
by Zaxo
in thread Merging two pipes
by cmburns
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |