read and sysread have very similar documentation. What are the differences between the two?
read
sysread
About read:
About sysread:
Summary and conclusions:
select
Notes:
These include, for example, tied file handles and those created using open(my $fh, '<', $var).
open(my $fh, '<', $var)
Before 5.14, Perl read in 4 KiB blocks. Since 5.14, the size of the blocks is configurable when you build perl, with a default of 8 KiB.
perl
In my experience, read will return exactly the amount requested (if possible) when reading from a plain file, but may return less when reading from a pipe. These results are by no means guaranteed.
fileno returns a non-negative number for these. These include, for example, handles that read from plain files, from pipes and from sockets, but not those mentioned in [1].
fileno
I'm referring to the 4-argument one called by IO::Select.
2.1m questions
2.1m answers
60 comments
57.0k users