sub run { while(1) { my @ready; print "about to check buffers\n"; unless(@ready = $buffer->ready) { select(undef, undef, undef, 0.001); next; } print "just after checking buffers\n"; foreach my $fh (@ready) { my $self = $objects{$fh}; while(my $line = $buffer->sysreadline($fh)) { chomp($line); $self->_process($line); } } } }