#!/usr/bin/perl -w #use strict; use warnings; use Net::SFTP; my $server="XXXXXXXX"; my %args = (ssh_args => { identity_files => [ "/XXXXXXXXXX" ],debug => 2, } ); $args{debug} = 1; $args{user} = "XXXXXXXX"; my $sftp=Net::SFTP->new($server, %args); $sftp->ls("." , sub { print $_[0]->{longname}, "\n" }); $sftp->put("helloabc.txt", "helloabc.txt"); $sftp->get("S1H62009.txt", "S1H62009.txt"); exit;