sebastiannielsen2 has asked for the wisdom of the Perl Monks concerning the following question:
I have a device which sends chunks of data each 30 seconds. No delimiter, no end of line and no way ever to see if the device is finished sending data.
The device sends its data through STDIN. (actually, its xinetd that receives data through a socket and then sends it to STDIN of the program).
What I need, is a function, that Waits indefinitely until SOMETHING is available on STDIN, and once SOMETHING is available on STDIN, it will "read" in 7 seconds, and then continue.
Amother way to do it could be to wait until SOMETHING is abailable to STDIN, and then "read" until the device has been silent for 5 seconds, then I can consider the device finished with its data block.
Any way to accomplish this in perl?
|
|---|