diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 1f4fec705677..4893f1e98ce5 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -9572,6 +9572,17 @@ the string. A positive OFFSET greater than the length of SCALAR results in the string being padded to the required size with C<"\0"> bytes before the result of the read is appended. + open(my $FH, "<", "input.txt") or die("Cannot open file: $!"); + + my $buf = ""; + my $num = 0; + + # Read up to 64 bytes + $num = sysread($FH, $buf, 64); + + # Read up to 32 bytes into position 512 of $buf + $num = sysread($FH, $buf, 32, 512); + There is no syseof() function, which is ok, since L|/eof FILEHANDLE> doesn't work well on device files (like ttys) anyway. Use L|/sysread FILEHANDLE,SCALAR,LENGTH,OFFSET> and