So uh, basically you want to open a filehandle and read data from it.. and keep reading.. and keep reading.. and you have no way to tell when to stop? Seems rather unsolvable to me.
Not really. Read for X amount of seconds, then quit reading. My sleep doesn't seem to be doing that. I will try some of the solutions below and see what happens.