首页 > 代码库 > read/sysread区别

read/sysread区别

 1 use warnings;
 2 use strict;
 3 my $readbuff;
 4 my $sysreadbuff;
 5 
 6 my $readbyt = read(STDIN, $readbuff, 10);
 7 print "read get:$readbuff\n";
 8 print "read return:$readbyt\n";
 9 my $sysreadbyt = sysread(STDIN, $sysreadbuff, 10);
10 print "sysread get:$sysreadbuff\n";
11 print "sysread return:$sysreadbyt\n";

sysread使用无缓冲

read使用缓冲

read/sysread区别