use strict; use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new('my_host') or die "$!"; $ssh->login('my_user', 'my_password'); my ($stdout, $stderr, $exit) = $ssh->cmd('ls'); print "$stdout";