#!/usr/bin/perl use strict; use warnings; use Net::SFTP; my $host = '127.0.0.1'; my %args = ( user => 'tinyos', ssh_args => [ port => "22" ] ); my $sftp = Net::SFTP->new($host, %args); my $ls = $sftp->ls('/home/user/Monks'); print "$_->{filename}\n" for (@$ls); __END__ $ perl test.pl benchmark.pl~ Foo sample.pl test.log out.txt sample.pl~ .. .. ..