my $chan = $ssh->channel(); $chan->ext_data('merge'); $chan->shell(); print $chan <send_eof; print while (<$chan>); $chan->wait_eof; $chan->close;