my $len = 131; my $resp = ''; while ( sysread $socket, $_, $len ) { $repsp .= $_; last if length($resp) >= $len; }