close_slave_pty => 0 When a pseudo pty is used for the stdin stream, the slave side is automatically closed on the parent process after forking the ssh command. This option disables that feature, so that the slave pty can be accessed on the parent process as $pty->slave. It will have to be explicitly closed (see IO::Pty). #### If you don't close channels/connections, they will be automatically closed for you from the objects destructors when they go out of scope. The advantage of doing it explicitly is that you can catch errors.