#!/usr/bin/perl use strict; use warnings; use Net::SSH::Perl; use Data::Dumper; my $Host = "xxxxxx"; my $User = "xxxxxx"; my $Secret = "xxxxxx"; my $Path="/home/ree"; #Connect my $ssh = Net::SSH::Perl->new($Host); $ssh->login($User, $Secret); # Execute the command my($stdout, $stderr, $exit) = $ssh->cmd("ls -l $Path");