in reply to Re^5: Speed reading (files)
in thread Speed reading (files)
Great. That clarified things. On a non-file handle, read will wait for more input to become available if the buffer doesn't contain enough to satisfy the request, whereas sysread returns what is available without waiting (subject to EOLs):
P:\test>p1 perl> print read STDIN, $in, 10; print "'$in'";; 1234 5678 10 '1234 5678 ' perl> print sysread STDIN, $in, 10; print "'$in'";; 1234 6 '1234 '
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Speed reading (files)
by kwaping (Priest) on Aug 05, 2005 at 14:49 UTC | |
by BrowserUk (Patriarch) on Aug 05, 2005 at 14:58 UTC | |
by kwaping (Priest) on Aug 05, 2005 at 15:38 UTC |