קריאה#

Read up to $nbytes bytes from $fd into $buffer.

תקציר#

use POSIX qw(read);
my $buf = "";
my $n = read($fd, $buf, 4096);

מה מוחזר#

On success, the number of bytes read (or "0 but true" for EOF); on failure, undef (with $! set). The data is written into $buffer in place - truncated or grown to match the actual read length.

מקרי קצה#

  • Partial reads are normal on pipes, sockets, and terminals; always check the return length.

הבדלים מן ה-upstream#

Fully compatible with upstream POSIX.