Ok, I needed to switch from Net:SFTP to Net:SFTP:Foreign to trap errors. But now the intial 'ls' I am putting into a hash complains: Not a HASH reference at ./test-perl-sftp-get.pl line 103. ( next if $entry->{filename} =~ /^\./;)