note
philcrow
When working with raw bytes, it pays to use the read method. It will block until something is available, then read up to a specified number of bytes:
<code>
# from Programming Perl
my $buffer;
while ( read $your_handle, $buffer, 1024 ) {
# process buffer here
}
</code>
That will read up to 1K from the handle, blocking if nothing is there, but returning whatever is there (the first 1K of it anyway).
<p>
The Perl Cookbook is an excellent reference for doing this sort of work.
<p>
Phil
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-480254">
The <a href='http://stores.lulu.com/philcrow'>Gantry Web Framework Book</a> is now available.
</div></div>
644041
644041