#pseudocode my $data while ($select->can_read){ if ( (my $length = sysread $reader, $data, 4096) > 0) { # do something with $data } }