@H_403_4@
如何检测Ctrl D以便在Perl中突破循环?
while (1){ $input = <STDIN>; print $input; #This is where I would check for CTRL+D #last if ($input equals to CTRL+D); EXIT LOOP if($input > 0){ print " is positive\n"; } elsif($input < 0){ print " is negative\n"; } else { print " is zero\n"; } }@H_403_4@