in reply to Re^3: IO::Handle read error description?
in thread IO::Handle read error description?

I was thinking sysread(... 4096 ... will block until read all 4096 bytes...
  • Comment on Re^4: IO::Handle read error description?

Replies are listed 'Best First'.
Re^5: IO::Handle read error description?
by ikegami (Patriarch) on Apr 28, 2010 at 19:44 UTC
    It will return whatever bytes are available.
    $ perl -e'$|=1; print "a"; print "b"; sleep 1; print "c"' | \ perl -le'print "[$buf]" while sysread(STDIN, $buf="", 4096);' [ab] [c]