$gotit = $PortObj->streamline; # poll until data ready $gotit = $PortObj->streamline($count);# block until $count chars received # fast alternatives to lookfor with no character processing #### at the top of your code, put: $|=1: # turns off buffering for print() sub Receive3 { my $gotit = $ob->streamline; die "got undef from streamline! $!" if (!defined ($gotit)); return if ($gotit eq ""); # nothing to do - no chars received print "$gotit"; # blocking call, but "fast enough" # actual code would do something with $gotit # put it in a buffer and decide if it is enough for # a complete command or whatever... }