<p>When reading from a <a href="http://search.cpan.org/dist/IO" rel="nofollow noreferrer">IO::Socket::INET</a> filehandle it can not be assumed that there will always be data available on the stream. What techniques are available to either peek at the stream to check if data is available or when doing the read take no data without a valid line termination and immediately pass through the read?</p>

Set the
```
Blocking
```
option to
```
0
```
when creating the socket:
```
```
$sock = IO::Socket::INET->new(Blocking => 0, ...);
```
```