use Net::SFTP; $SFTPSite = 'sftp.xxxxbroker' ; $userid = 'fred'; $pword = 'bedrock'; #** ** ** ** ** ** ** ** # Setup to do the SFTP $sftp = Net::SFTP->new( $SFTPSite, $userid, $pword ) or die "Could NOT create SFTP " ; #Net::SFTP constructor @entries = $sftp->ls('/'); # slurp all entries into an array foreach $entry (@entries) { print "$entry \n"; chomp $entry; my @fields = split /\s+/, $entry; print "the file name: " . $fields[-1] . "\n"; }