my $ssh = Net::OpenSSH->new($target, gateway => { proxies => ['ssh://serverA', 'ssh://serverB'] }); my $output = $ssh->capture('ls');