in reply to sysread()

select may help. IO::Select is also nice.