Here's some semi-tested client code that reads what it can. then does the inner loop for each whole line.
my $sock = IO::Socket::INET->new('127.0.0.1:1235') or die "sock: $@";
my $sel = IO::Select->new($sock);
my $buffer = '';
while(@1 = $sel->can_read(2) and sysread $sock, $buffer, 4096, length
while( $buffer =~ s/^.*\n// )
my $line = $&;
print "got: ", $line; # or whatever processing you want here...
die @1 ? "socket closed" : "timeout";
If you change the read size to 1 you get the read-a-byte-at-a-time behavior.