in reply to SSH and expect without module

If you want to do password authentication, then you need Expect or the lower level IO::Pty installed, or some helper command as sshpass or a SSH client as plink which accepts the password as a command line argument.

The issue is that ssh doesn't read the password from STDIN but directly from the tty and Perl doesn't offer a way to manipulate ttys/ptys without using some non core module.