我试图理解这个 $!=0 ,我的主管在这个链接中给了我鳕鱼:http: //codepaste.ru/1374/ 但她改变了这部分鳕鱼:
while($client || $target) {
my $rin = "";
vec($rin, fileno($client), 1) = 1 if $client;
vec($rin, fileno($target), 1) = 1 if $target;
my($rout, $eout);
select($rout = $rin, undef, $eout = $rin, 120);
if (!$rout && !$eout) { return; }
my $cbuffer = "";
my $tbuffer = "";
if ($client && (vec($eout, fileno($client), 1) || vec($rout, fileno($client), 1))) {
my $result = sysread($client, $tbuffer, 1024);
if (!defined($result) || !$result) { return; }
}
对此:
while($client || $target) {
my $rin = "";
vec($rin,fileno($client),1) = 1 if $client;
vec($rin,fileno($target),1) = 1 if $target;
my($rout,$eout);
select($rout = $rin,undef,$eout = $rin,120);
break_pipe() if !$rout && !$eout;
my($cbuf,$tbuf);
if($client && (vec($eout,fileno($client),1) || vec($rout,fileno($client),1))){
$! = 0;
my $result = sysread($client,$tbuf,$packet_length);
我已经搜索过,但在 perl 中没有找到类似这种语法($!=0)的东西