my $data = ''; my $buf; while(1) { eval { my $status = sysread(STDIN, $buf, 1); }; last if(!length($buf)); $data .= $buf; $buf = undef; }