use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new("myhost", debug => 1, protocol => 2); $ssh->login("myUser", "myPassword"); my ($out, $error) = $ssh->cmd("pwd"); print $out . "\n";