<p>I'm writing some server code that talks to a client process via STDIN. I'm trying to write a snippet of perl code that asynchronously receives responses from the client's STDOUT. The blocking version of the code might look like this:</p>

<pre><code>sub _read_from_client
{
   my ($file_handle) = @_;
   while (my $line = &lt;$file_handle&gt;) {
      print STDOUT $line;
   }
   return;
}
</code></pre>

<p>Importantly, the snippet needs to work in Win32 platform. There are many solutions for *nix platforms that I'm not interested in. I'm using ActivePerl 5.10.</p>

This thread
on
Perlmonks
suggests you can make a socket nonblocking on Windows in Perl this way:
```
```
ioctl($socket, 0x8004667e, 1);
```
```
More details and resources in that thread