my $sock = ... my $sel = IO::Select->new(); $sel->add($sock); while (1){ if ($sel->can_read(0.5)){ $line = <$socket>; print $line; } else { print "."; } } #end of while 1