in reply to Re^5: Net::OpenSSH tty error
in thread Net::OpenSSH tty error

Try to add 'tty => 1' to your 'capture' options:
my @ls = $ssh->capture( { tty => 1}, $cmd);