Net::OpenSSH constructor accepts two different sets of options to be passed to
ssh:
master_opts and
default_ssh_opts.
The first set goes into the ssh call that connects to the remote machine and creates the multiplexing socket.
The second set goes into the ssh calls that are used to run the remote commands (when calling system or capture, for instance). They reuse the connection established by the master ssh process, and so at that point it is usually too late to set most of the options supported by ssh. In practice, using default_ssh_opts is very uncommon.