my $exp = new Expect; #commands below are not being sent to the local machine command line and not sure why not? $exp->send("ssh root\@device203 install license < input/Licence321178.lic\r"); print "$exp\n"; sleep(1); $exp->send("admin\r"); sleep(1); # This next section uses Expect and SSH successfully my $ssh = Net::SSH::Expect->new ( host => "$host_details[1]", user => 'root', password => 'admin', raw_pty => 1, timeout => 1 ); #eval { my $login_output = $ssh->login(); if ($login_output !~ /loginprompt/) { die "Login has failed. Login output was $login_output"; }