http://www.perlmonks.org?node_id=1028090


in reply to Runing Remote Command

Try Net::OpenSSH (more powerfull, doesn't work on Windows) or Net::SSH::Any:
use Net::SSH::Any; my $ssh = Net::SSH::Any->new('10.253.0.1', user => 'admin', password => $password); $ssh->error and die "unable to connect to remote machine: " . $ssh->er +ror; my ($out, $err) = $ssh->capture2(cli => '"enable"', '"run"', '"reload" +'); $ssh->error and die "remote command failed: " . $ssh->error; print $out, $err;