http://www.perlmonks.org?node_id=11123460


in reply to Re^2: sysread blocking ??
in thread sysread blocking ??

I would have used:

if (!defined($stat)) { if $!{EAGAIN} || $!{EWOULDBLOCK}) { ... No data at this time ... } die "sysread: $!\n"; } if (!$stat) { ... EOF ... )