note
salva
[mod://Net::OpenSSH] can do it for you:
<c>
use Net::OpenSSH;
my $ssh = Net::OpenSSH->new($remotehost, user => $remoteuser, password => $remotepassword);
$ssh->die_on_error("unable to connect to remote host");
my ($out, $err) = $ssh->capture2(ls => '-l', $remotefile);
</c>
<p>Another option is to use SFTP:
<c>
use Net::SFTP::Foreign;
use Data::Dumper;
my $sftp = Net::SFTP::Foreign->new($remotehost,
user => $remoteuser, password => $remotepassword,
autodie => 1);
my $attr = $sftp->stat($remotefile);
print Dumper $attr;
</c>
1040994
1040994