my $ssh = Net::SSH::Expect->new ( host => "$current_server", user => "$user", raw_pty => 1 ); # removed the eval $login_output = $ssh->run_ssh(); print("$current_server \$! = $!\n"); print("Login output for $current_server = $login_output\n"); ($ssh->read_all(2) =~ />\s*|$\s*\z/) or die "where's the remote prompt?"; $ssh->exec("stty raw -echo");