Help for this page
my $f = $sftp->ls('/xxxx/xxxxx/outbound'); # $f instead of @files #removed a loop here foreach my $file_ref ( @{$files} ) {
my @files= grep (!/^\.\.?$/, @files); #or without regex my @files= grep ($_ ne "." and $_ ne "..", @files);