##
while (length $intext > 32767) {
$chan->write(substr($intext, 0, 32768, ''));
}
$chan->write("$intext\n");
$chan->send_eof();
####
ssh created
ssh connected
cmd is wc
intext length is 100000
1 1 100001
remote exit status is 0 bytes returned is 24 bytes