use warnings; use strict; use Net::SSH::Perl; my $command = "ls"; my $host = "192.168.112.191"; my $user = "admin"; my $pass = "admin\@123"; my $ssh = Net::SSH::Perl->new( $host ); $ssh->login( $user, $pass ); my($stdout, $stderr, $exit) = $ssh->cmd( $command ); print $stdout;