in reply to Net::OpenSSH mater mode is not working
You can further simplify this by utilizing a local ssh config, man 5 ssh_config, namely the master_opts => [-o => "StrictHostKeyChecking=no"] line. It certainly depends on the environment and control of the remote host, but you can also likely eliminate $login ? ( user => $login ) : (), $password ? ( password => $password ) : (), and port => $port, by leveraging the ssh config.