in reply to Perl Expect Help

Maybe you have a different sort of use case, but any time I'm scripting over SSH connections I've standardized on using SSH authorized keys and pre-populating the known hosts file. Just sort of unconditionally, everywhere. Then you can set BatchMode=yes and not need to worry about any prompts coming from ssh.