use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new($remotehost); $ssh->login($remoteuser, $remotepassword); my($stdout, $stderr, $exit) = $ssh->cmd(qq[ls -l $remotefile]); # Then parse the info I want from $stdout with an easy regex