my $bytes_read = read($fh, $buf, $to_read, length($buf));