You read one character a time, so there is no problem. See
read for details
Maybe i should have been more explicit. What i did is, reading one character at a time, and adding it to
$line. Until i find an end of line.
That's why i did
sysread, reading just one byte a time.
As i said, the producer never ending, you will never get eof (only if the producer knows to send eof).
Don't use while(1){} instead of
sleep ;-)