while (my $nread = sysread($JSREAD, my $buf, 1)) { print $buf; last if $nread == 0; }